Virtual fabric rendering method and device, equipment, storage medium and program product
By obtaining the rendering attribute information and configuration parameters of the virtual fabric model and optimizing the rendering process, the problem that existing rendering tools cannot render virtual fabrics with high quality is solved, and the rendering quality and authenticity are improved.
Patent Information
- Application Number
- CN202410425202.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-08
- Publication Date
- 2025-10-14
AI Technical Summary
Existing rendering tools cannot guarantee high-quality rendering of virtual fabrics, which affects the authenticity evaluation of fabric simulation in game programs.
By obtaining the rendering attribute information of the virtual fabric model, including the fabric material, the rendering configuration parameters for different fabric materials are obtained based on this information, the rendering tool is called for rendering, and the rendering process is optimized to improve the quality.
The rendering configuration is optimized according to the requirements of different fabric materials, which improves the rendering quality and realism of virtual fabrics.
Smart Images

Figure CN120782886A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer graphics, and in particular to a virtual fabric rendering method and device, equipment, a storage medium and a program product. BACKGROUND
[0002] In the development of some virtual games, especially realistic virtual games, the authenticity of fabric simulation effects is required to be high.
[0003] In the related art, a developer can pre-render a virtual fabric offline through a rendering tool to obtain Ground Truth (true value) of the virtual fabric; during game development, the virtual fabric effect generated by a game program is compared with the offline generated Ground Truth to evaluate the authenticity of fabric simulation of the game program.
[0004] However, the rendering tool in the related art is usually a general rendering tool provided by a third party, which cannot guarantee that the virtual fabric can be rendered to obtain high-quality Ground Truth, affecting the evaluation effect of fabric simulation of the game program. SUMMARY
[0005] The present application provides a virtual fabric rendering method, device, equipment, storage medium and program product, which can improve the offline rendering quality of the virtual fabric; the technical solution content is as follows:
[0006] According to an aspect of the present application, a virtual fabric rendering method is provided, which comprises:
[0007] Obtaining rendering attribute information of a virtual fabric model, the rendering attribute information comprising fabric material; the virtual fabric model comprising at least a model part corresponding to the fabric, and the fabric material being the material of the model part corresponding to the fabric;
[0008] Obtaining rendering configuration parameters based on the rendering attribute information, the rendering configuration parameters being configuration parameters used when rendering the virtual fabric model, and different rendering configuration parameters corresponding to at least two fabric materials;
[0009] Calling a rendering tool to create the virtual fabric model, and setting the rendering configuration parameters in the rendering tool, so that the rendering tool renders the virtual fabric model based on the rendering configuration parameters to obtain at least one frame of rendering picture.
[0010] According to an aspect of the present application, a virtual fabric rendering device is provided, which comprises:
[0011] An information acquisition module is used to acquire rendering attribute information of a virtual fabric model, wherein the rendering attribute information includes fabric material; the virtual fabric model at least includes a model portion corresponding to the fabric, and the fabric material is the material of the model portion corresponding to the fabric;
[0012] A parameter acquisition module, configured to acquire rendering configuration parameters based on the rendering attribute information, wherein the rendering configuration parameters are configuration parameters used when rendering the virtual fabric model, and there are at least two fabric materials corresponding to different rendering configuration parameters;
[0013] The model rendering module is used to call a rendering tool to create the virtual fabric model, and to set the rendering configuration parameters in the rendering tool so that the rendering tool renders the virtual fabric model based on the rendering configuration parameters to obtain at least one frame of rendered image.
[0014] In some embodiments, the rendering attribute information further includes scene information, and the scene information is used to indicate a scene when rendering the virtual fabric model;
[0015] The parameter acquisition module is used to acquire the rendering configuration parameters based on the fabric material and the scene information.
[0016] In some embodiments, the parameter acquisition module is used to query a first rendering configuration parameter corresponding to the fabric material, and query a second rendering configuration parameter corresponding to the scene information, and acquire the first rendering configuration parameter and the second rendering configuration parameter as the rendering configuration parameter;
[0017] Alternatively, the parameter acquisition module is used to query the rendering configuration parameters corresponding to the combination of the fabric material and the scene information.
[0018] In some embodiments, the information acquisition module is configured to acquire the fabric material of the virtual fabric model in response to a material setting operation;
[0019] or,
[0020] In the case that the model file of the virtual fabric model includes the description information of the fabric material, the information acquisition module is used to acquire a fabric material that matches the description information of the fabric material from various materials supported by the rendering tool.
[0021] In some embodiments, the information acquisition module is used to:
[0022] Get the name of each material; the material name is the name of the material supported by the rendering tool;
[0023] Obtaining the similarity between each material name and the description information of the fabric material;
[0024] Determine at least two candidate materials from the materials corresponding to the respective material names in descending order of the similarities;
[0025] Displaying preview information of at least two candidate materials, wherein the preview information includes a preview image and the material name;
[0026] When a selection operation on the preview information of a target candidate material is received, the target candidate material is acquired as a fabric material that matches the description information of the fabric material; the target candidate material is one of at least two candidate materials.
[0027] In some embodiments, the model rendering module is used to obtain a rendering data file; the rendering data file contains at least shape information of the virtual fabric model and extended information corresponding to the fabric material; the extended information includes one or more of the following: collision body parameters and physical property parameters;
[0028] The model rendering module is used to call the rendering tool to generate the virtual fabric model based on the rendering data file.
[0029] In some embodiments, the model rendering module is used to load a model file of the virtual fabric model; the model file at least contains the shape information;
[0030] Acquire extended information data, where the extended information data is used to indicate the extended information;
[0031] The model file and the extended information data are serialized to generate the rendering data file.
[0032] In some embodiments, the model rendering module is configured to receive an extension setting operation and obtain the extension information data based on the extension setting operation;
[0033] Alternatively, the extended information data corresponding to the fabric material is queried.
[0034] In some embodiments, the shape information includes a fabric mesh file, and the fabric mesh file is used to indicate a mesh of the virtual fabric model;
[0035] In the case where the extended information includes the physical property parameters, the model rendering module is used to load the fabric mesh file;
[0036] The device further includes: a mapping setting module for setting a mapping relationship between the mesh of the virtual fabric model and the physical property parameters based on the fabric mesh file; the mapping relationship is used to create the virtual fabric model with the physical property parameters.
[0037] In some embodiments, the device further comprises: a pre-processing module for selecting a pre-processing method based on the fabric material; the pre-processing comprises one or more of the following processing methods: data cleaning, denoising, data smoothing, level of detail adjustment (LOD) setting, and collision body optimization;
[0038] The preprocessing module is configured to process the rendering data file based on the preprocessing method to obtain the preprocessed rendering data file;
[0039] The model rendering module is used to call the rendering tool to generate the virtual fabric model based on the preprocessed rendering data file.
[0040] In some embodiments, the device further comprises: a post-processing module for selecting a post-processing method based on the fabric material; the post-processing includes one or more of the following processing methods: color adjustment and visual effect enhancement;
[0041] The post-processing module is used to process at least one frame of the rendered image based on the post-processing method.
[0042] According to another aspect of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the virtual fabric rendering method as described above.
[0043] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores at least one computer instruction, and the at least one computer instruction is loaded and executed by a processor to implement the virtual fabric rendering method as described above.
[0044] According to another aspect of the present application, a computer program product is provided, comprising computer instructions stored in a computer-readable storage medium, wherein a processor reads and executes the computer instructions from the computer-readable storage medium to implement the virtual fabric rendering method described above.
[0045] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0046] For virtual fabrics, different fabric materials have different requirements for the optimization of the rendering process. For example, for different fabric materials, if you want to achieve the ideal rendering effect, you need to make different optimizations in the rendering configuration in terms of transparency, glossiness, lighting, shadow, etc.; in this regard, the solution shown in the embodiment of the present application determines the rendering configuration parameters used for rendering the current virtual fabric model through the rendering attribute information such as the fabric material of the virtual fabric model, thereby optimizing the rendering process of the virtual fabric model according to the fabric material. When the virtual fabric model is subsequently rendered using the rendering configuration parameters, better rendering effects can be achieved, thereby improving the rendering quality of the virtual fabric. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0048] Figure 1 is a schematic diagram of a computer device provided by an exemplary embodiment of the present application;
[0049] Figure 2 is a flow chart of a method for rendering virtual fabrics provided by an exemplary embodiment of the present application;
[0050] Figure 3 This is a schematic diagram of an interface for previewing information provided by an exemplary embodiment of the present application;
[0051] Figure 4 This is a rendering of a virtual fabric model provided by an exemplary embodiment of the present application;
[0052] Figure 5 is a schematic diagram of a rendering data file provided by an exemplary embodiment of the present application;
[0053] Figure 6 This is a schematic diagram of a virtual fabric rendering system framework provided by an exemplary embodiment of the present application;
[0054] Figure 7 is a flow chart of a method for rendering virtual clothing provided by an exemplary embodiment of the present application;
[0055] Figure 8 This is a schematic diagram of a rendering process of a virtual garment provided by an exemplary embodiment of the present application;
[0056] Figure 9 is a schematic diagram of a physical model provided by an exemplary embodiment of the present application;
[0057] Figure 10 This is a flow chart of a method for rendering character costumes provided by an exemplary embodiment of the present application;
[0058] Figure 11 This is a flow chart of a method for rendering virtual fashion provided by an exemplary embodiment of the present application;
[0059] Figure 12 is a block diagram of a virtual fabric rendering device shown in an exemplary embodiment of the present application;
[0060] Figure 13 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application.
[0061] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application. DETAILED DESCRIPTION
[0062] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0063] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0064] The terms used in this disclosure are for the purpose of describing particular embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0065] In the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the object behaviors such as attack operations involved in this application are all obtained with full authorization.
[0066] It should be understood that although the terms first, second, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter without departing from the scope of this disclosure. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0067] The following are some definitions of terms involved in this application:
[0068] 1) Fabric physics simulation technology: This is a computer simulation technology based on physics principles that simulates the physical behavior and movement of fabrics in virtual scenes. Fabric physics simulation technology can simulate physical properties such as elasticity, friction, and air resistance to achieve more realistic fabric simulation effects. In virtual scenes (such as virtual games), fabric physics simulation technology can be used to simulate the movement and deformation of virtual characters' clothing, hair, canvas, and other items to enhance the realism and visual effects of the virtual scene.
[0069] Fabric physics simulation technologies include real-time and offline fabric simulation technologies. Real-time fabric simulation refers to the real-time calculation and simulation of the physical behavior of fabrics, allowing virtual fabrics to appear smooth, natural, and consistent with the real world in virtual scenes. Offline fabric simulation refers to the pre-calculation and simulation of the physical behavior of fabrics to generate realistic fabric simulation effects. Unlike real-time fabric simulation, offline fabric simulation does not require real-time calculations and can perform complex physical simulations and rendering in the background. This can produce highly realistic fabric dynamic effects, simulating complex fabric stacking, wrinkle formation, fluid dynamics interactions, and more.
[0070] 2) Ground Truth: This refers to the actual physical behavior and state of fabrics in the real world. To achieve realistic physical effects in virtual scenes, developers typically use a physics engine to simulate the movement, collisions, and interactions of fabrics. However, the simulation results of the physics engine may differ from the real-world performance. Therefore, to evaluate the accuracy and realism of the physics simulation, developers can compare the simulation results of the physics engine with the real-world Ground Truth.
[0071] Ground truth can be obtained through actual measurements, experimental data, or simulations of real-world behavior. For example, for a jumping virtual character, the ground truth can be obtained through actual measurements or by simulating the height, speed, and trajectory of a human jump using offline fabric simulation technology. Alternatively, the height, speed, and trajectory of the virtual character's jump can be simulated offline, with the offline simulation results used as the ground truth. The simulation results from the physics engine are then compared with the ground truth to assess the accuracy and authenticity of the simulation output from the physics engine.
[0072] That is to say, by comparing the simulation results of the physics engine and Ground Truth, developers can determine whether the simulation performance of the physics engine has achieved the expected effect and make necessary adjustments and optimizations. Ground Truth helps developers improve the physics simulation algorithm, adjust the physical properties of objects or adjust the parameters of the physics engine to make the simulation effect of the physics engine closer to the behavior of the real world.
[0073] 3) Self-collision and capsule collision: Self-collision refers to the collision between different parts inside an object; for example, during clothing simulation, due to the soft texture of clothing, self-collisions may occur between different layers of clothing, or when clothing is folded, collisions may also occur between different parts of the clothing on both sides of the folded position. Capsule collision: refers to the collision between an object and a capsule collider; a capsule collider can be composed of two spheres and a cylinder connecting the two spheres, and is often used to simulate collisions between rigid bodies. In fabric physics simulation technology, capsule collisions are often used to simulate collisions between fabrics and rigid bones or other rigid objects.
[0074] 4) Mesh-to-Mesh Skinning Technology: A technology that projects a high-precision rendering mesh onto a low-precision physical mesh, which can ensure high computational efficiency without sacrificing detail performance. In this application, the high-precision rendering mesh can be the surface mesh of the fabric model that the user sees in the virtual scene. The number of vertices and triangles in the model is large to support rich detail performance; the low-precision physical mesh can be a simplified model used for fabric physical simulation in this application. The number of vertices and triangles in the model is small to optimize computing speed. Exemplarily, the process of mesh-to-mesh skinning in virtual fabric simulation is as follows:
[0075] S1, create high-precision rendering mesh: create a high-precision rendering mesh for the virtual fabric, which contains all the visual details of the virtual fabric;
[0076] S2, create a low-precision physical mesh: Create a low-precision physical mesh based on the high-precision rendering mesh. This physical mesh will be used for actual physical simulation. The number of vertices of the physical mesh is much lower than that of the rendering mesh, which can save computing resources during the simulation;
[0077] S3, Mesh Mapping: Mapping the simulated motion and deformation results on the low-precision physical mesh to the high-precision rendering mesh;
[0078] S4, Skinning: Each vertex of the rendered mesh is associated with one or more vertices of the physical mesh through weight binding; when the simulation is running, the vertices of the rendered mesh will move according to the movement of the corresponding physical vertices, thereby emulating the movement of the fabric.
[0079] Please refer to Figure 1 , which shows a schematic diagram of a computer system provided by an exemplary embodiment of the present application. The computer system can be implemented as a virtual fabric rendering system. The computer system may include: a terminal device 110 and a server 120.
[0080] The terminal device 110 can be an electronic device such as a personal computer (PC), a tablet computer, a mobile phone, a wearable device, a vehicle-mounted terminal, etc. A client that runs a target application can be installed in the terminal device 110, and the target application can be an application with a model rendering function, such as a rendering engine. Exemplarily, the target application is a rendering engine, and the target application can run a rendering tool to render the virtual model according to the rendering tool to generate at least one frame of rendered image. The rendering tool can be a plug-in based on the target application, or it can be an application independent of the target application. In addition, the present application does not limit the form of the target application, including but not limited to applications (Application, App) installed in the terminal device 110, applets, etc., and can also be in the form of a web page.
[0081] The model rendering function of the target application program can be applied to the development of a virtual scene application program, such as a simulation program, a shooting application program, a racing application program, a virtual reality (VR) application program, an augmented reality (AR) program, a map program, a game application program, and the like. For example, the virtual scene application program is a game application program, and the game application program includes a simulation game (SLG), a battle royal shooting game, a virtual reality game, an augmented reality game, a first-person shooting game (FPS), a third-person shooting game (TPS), a multiplayer online battle arena game (MOBA), and the like. The present application is not limited thereto.
[0082] In some embodiments, the virtual scene application program can provide a virtual scene, which is a scene displayed (or provided) by the application program when running on a terminal device, so that the virtual object taken over and operated by the user can perform activities such as walking and fighting in the virtual scene. Optionally, the terminal device 110 runs a client of the application program.
[0083] The virtual scene refers to a scene that provides activities (such as game competition) or operations for virtual objects or users, such as virtual houses and virtual islands. The virtual scene can be a simulated world of the real world, a semi-simulated and semi-fictional three-dimensional world, or a purely fictional three-dimensional world. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, and a three-dimensional virtual scene. The virtual object refers to an active object in the virtual scene controlled by the user in the target application program, which can be at least one of a virtual character, a virtual animal, and an animation character.
[0084] The server 120 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The server 120 can be a background server of the target application program, which provides background services for the client of the target application program.
[0085] The terminal device 110 and the server 120 can communicate through a network, such as a wired or wireless network.
[0086] For example, the virtual fabric processing method is applied to obtain the simulation animation of the virtual clothes.
[0087] The terminal device 110 sends the model file 101 of the virtual clothing model to the server 120, where the model file 101 is used to indicate the shape and animation of the virtual clothing model, the fabric material of the virtual clothing, and the scene when rendering the virtual clothing model; the server 120 receives the model file 101, and obtains the rendering data file 102 based on the model file 101, where the rendering data file 102 is used to indicate the shape, animation, collision body, and physical properties of the virtual clothing model; the server 120 obtains the rendering configuration parameters 103 based on the model file 101; the server 120 renders the virtual clothing model indicated by the above-mentioned rendering data file 102 based on the rendering configuration parameters 103, and obtains multiple frames of rendered images 104; the server 120 integrates the above-mentioned multiple frames of rendered images 104 into a simulated animation 105 of the virtual clothing, and then sends the simulated animation 105 to the terminal device 110.
[0088] Please refer to Figure 2 , which shows a flowchart of a virtual fabric rendering method provided by an exemplary embodiment of the present application. The method is executed by a computer device, and optionally, the computer device can be Figure 1 The terminal device 110 in the system shown, or the computer device can also be Figure 1 The server 120 in the system shown, or the computer device may also include Figure 1 The terminal device 110 and the server 120 in the system are shown. Figure 2 As shown, the method may include step 210 , step 220 and step 230 .
[0089] Step 210: Obtain rendering attribute information of the virtual fabric model, where the rendering attribute information includes fabric material. The virtual fabric model at least includes a model portion corresponding to the fabric, and the fabric material is the material of the model portion corresponding to the fabric.
[0090] The rendering attribute information is used to indicate the attributes related to the rendering effect among the various attributes of the virtual fabric model.
[0091] The fabric material refers to the material and texture of the above-mentioned model part, which can reflect the texture and texture of the model part.
[0092] Exemplarily, the fabric material may include but is not limited to one or more of the following: cotton, linen, silk, woolen cloth, leather, denim, and hair.
[0093] Step 220: Obtain rendering configuration parameters based on the rendering attribute information; the rendering configuration parameters are configuration parameters used when rendering the virtual fabric model.
[0094] In an embodiment of the present application, there are at least two fabric materials corresponding to different rendering configuration parameters; that is, multiple fabric materials correspond to their own rendering configuration parameters, and the rendering configuration parameters corresponding to the multiple fabric materials are different, or the rendering configuration parameters corresponding to the multiple fabric materials are not completely the same.
[0095] In an exemplary solution, a correspondence between various fabric materials and rendering configuration parameters can be pre-set. The correspondence can be stored in a computer device or in other devices (such as a server). After the computer device obtains the above-mentioned rendering attribute information, it can query the corresponding rendering configuration parameters from the above-mentioned correspondence through the fabric material in the rendering attribute information.
[0096] In some embodiments, the rendering configuration parameters may include one or more of the following parameters:
[0097] Color, transparency, glossiness, lighting setting parameters, reflection parameters, refraction parameters, shading model, sampling rate, shadow parameters, ray tracing parameters.
[0098] The following describes the above rendering configuration parameters:
[0099] 1) Transparency corresponds to the light transmittance of virtual fabrics of different fabric materials. This can indicate the change in color of the virtual fabric after light passes through it, as well as the degree to which the scene behind the virtual fabric can be seen through the virtual fabric. For example, transparency can be represented by an alpha value, which ranges from 0 to 1 (0 represents transparency and 1 represents opacity).
[0100] 2) Glossiness corresponds to the specular reflectivity of virtual fabrics of different fabric materials. This determines whether the reflection effect on the virtual fabric surface is blurred, diffuse, or sharp, specular. For example, virtual fabrics of materials like leather and silk have a high glossiness, and the reflected light from the surface of these high-gloss virtual fabrics is relatively concentrated. Virtual fabrics of materials like woolen, cotton, and linen have a low glossiness, and the reflected light from the surface of these low-gloss virtual fabrics is more dispersed.
[0101] 3) The lighting setting parameters correspond to the position, intensity, color, and other information of the light source in the virtual scene; for example, when the surface of the virtual fabric has wrinkles, the shadow range of the virtual fabric surface caused by light sources in different positions is different.
[0102] 4) Reflection parameters correspond to the reflection effects of virtual fabrics of different fabric materials. For example, the reflection parameters may include one or more of the following parameters:
[0103] Roughness: This value indicates the smoothness of the surface of a virtual fabric. For example, a virtual fabric with a rough surface will not have a clear mirror reflection, but rather a scattered or blurred reflection effect.
[0104] Reflectivity Intensity: This value indicates the degree to which a virtual fabric reflects light. For example, a virtual fabric with higher glossiness has a higher reflection intensity.
[0105] 5) Refraction parameters correspond to the refraction effects of virtual fabrics of different fabric materials. For example, the refraction parameters may include one or more of the following parameters:
[0106] Index of Refraction (IOR): This represents the change in light speed when it passes from one medium to another. It helps simulate the scattering and color absorption of light after it passes through virtual fabrics.
[0107] Subsurface Scattering: For virtual fabrics made of materials such as cotton and linen, light penetrates beneath the surface of the virtual fabric and scatters out, making the visual effect of the virtual fabric fuller and softer.
[0108] 6) Shading models correspond to the interaction between the virtual fabric surface and light of different fabric materials; wherein, the shading model can control the reflected light and the incident light of the virtual fabric. For example, the shading model includes one or more of the following types:
[0109] Phong shading model: used to simulate diffuse reflection, specular reflection, and ambient reflection, and can show the basic gloss and reflective properties of virtual fabrics of different fabric materials;
[0110] Blinn-Phong shading model: Improved from the Phong shading model, it increases the speed of highlight calculation and is also suitable for simulating specular reflection effects on virtual fabric surfaces, especially virtual fabrics with obvious highlight areas (such as satin).
[0111] 7) The sampling rate corresponds to the clarity of the rendering result. The higher the sampling rate, the less noise the rendered image will have and the clearer the rendered image will be. However, the amount of computation required for rendering will also increase, resulting in longer rendering time. Therefore, an appropriate sampling rate can ensure the clarity of the rendered image without excessively affecting the rendering speed.
[0112] 8) Shadow parameters correspond to the degree of shadowing in areas of the fabric surface that are not directly illuminated. This includes the degree to which the fabric surface casts or receives shadows, as well as the characteristics of the shadows themselves, such as depth, blurriness, and color. By adjusting shadow parameters, the realism of the virtual fabric can be enhanced, allowing the virtual fabric to display richer and more delicate shadow expressions under different lighting conditions. For example, shadow parameters may include one or more of the following parameters:
[0113] Shadow depth and intensity: refers to the depth, visibility, and contrast of dark areas created when the virtual fabric surface is obscured;
[0114] Shadow spread and softness: This is related to the size and distance of the light source, as well as the roughness of the virtual fabric, and is reflected in the degree of blurriness of the shadow edge. For example, the shadow edge of a virtual fabric with high roughness will be relatively soft, while the shadow edge of a virtual fabric with low roughness will be relatively sharp.
[0115] 9) Ray tracing parameters are used to enhance the realism and visual effects of virtual fabrics under lighting. For example, ray tracing parameters can include ray tracing depth, which reflects the propagation and interaction of light in the virtual scene. Appropriate ray tracing depth can help improve the quality of rendered images.
[0116] The rendering configuration parameters involved in the embodiments of the present application may include multiple types of parameters, providing multiple optional combinations for the rendering configuration parameters. In the subsequent rendering process, based on the rendering configuration parameters, it is possible to more accurately simulate the propagation of light in the real world and the interaction between light and fabric materials, thereby generating realistic lighting and shadow effects, thereby improving the authenticity of the rendered image.
[0117] Step 230: calling a rendering tool to create a virtual fabric model, and setting rendering configuration parameters in the rendering tool so that the rendering tool renders the virtual fabric model based on the rendering configuration parameters to obtain at least one frame of rendered image.
[0118] Among them, the computer device can render the virtual fabric model through the rendering tool. During this process, the computer device can configure the above-mentioned rendering configuration parameters in the rendering tool, so that the rendering tool can render the virtual fabric model according to the above-mentioned rendering configuration parameters, so that the rendering image generated by the rendering tool can accurately and realistically present the texture, lighting, reflection effects, etc. of the virtual fabric model.
[0119] For example, the computer device may call a rendering tool to create a virtual fabric model; wherein the step of creating the virtual fabric model by the rendering tool may be performed before step 210 or during steps 210 to 230. The computer device then configures the rendering configuration parameters obtained in step 220 in the rendering tool, and renders the virtual fabric model using the rendering tool to obtain one or more frames of rendered images generated by the rendering tool.
[0120] Exemplarily, the rendering tool may render the virtual fabric model using an offline rendering process. The offline rendering process of the virtual fabric model may include the following steps:
[0121] 1) Creating a virtual fabric model: The computer device may call a rendering tool to create a virtual fabric model; for example, the computer device may pass a model file of the virtual fabric model to the rendering tool, which may load the model file and create the virtual fabric model based on data in the model file;
[0122] 2) Setting rendering configuration parameters: The computer device configures parameters such as color, transparency, glossiness, lighting setting parameters, reflection parameters, refraction parameters, shading model, sampling rate, shadow parameters, and ray tracing parameters in the rendering tool based on the obtained rendering configuration parameters;
[0123] 3) Single-frame rendering: The rendering tool performs single-frame rendering operations on the virtual fabric model to generate high-quality images;
[0124] 4) Confirm image quality: The user checks whether the rendered image meets the quality requirements. If necessary, adjust the rendering configuration parameters and repeat the above rendering steps.
[0125] In some embodiments, in response to obtaining multiple frames of rendered images of the virtual fabric model, the computer device can integrate the above multiple frames of rendered images into an animation sequence, thereby obtaining the animation effect of the virtual fabric model and improving the subsequent evaluation effect of the physical simulation of the virtual fabric.
[0126] To sum up, for virtual fabrics, different fabric materials have different requirements for the optimization of the rendering process. For example, for different fabric materials, if you want to achieve the ideal rendering effect, you need to make different optimizations in the rendering configurations in terms of transparency, glossiness, lighting, shadow, etc.; in this regard, the solution shown in the embodiment of the present application determines the rendering configuration parameters used for rendering the current virtual fabric model through the rendering attribute information such as the fabric material of the virtual fabric model, thereby optimizing the rendering process of the virtual fabric model according to the fabric material. When the virtual fabric model is subsequently rendered using the rendering configuration parameters, better rendering effects can be achieved, thereby improving the rendering quality of the virtual fabric.
[0127] For example, the rendering attribute information can be set by the user, allowing the user to customize the rendering effect of the virtual fabric model; that is, the user can manually set the fabric material and other information of the virtual fabric model. For example, the user can set the fabric material used to render the virtual fabric model in the settings interface of the editing tool. For another example, the user can enter the fabric material description information in the settings interface of the virtual fabric model development tool, and the development tool will add the fabric material description information to the model file of the virtual fabric model.
[0128] In some embodiments, the above step 210 may be implemented as: in response to the material setting operation, obtaining the fabric material of the virtual fabric model.
[0129] For example, in an offline rendering scenario, a rendering tool and an editing tool other than the rendering tool may be running in a computer device. The above step 210 may be performed by the editing tool. Specifically, for example, the editing tool may display a material setting control, and the user may use the material setting control to select one or more fabric materials from various pre-set fabric materials. The editing tool may obtain the fabric material of the virtual fabric model based on the user's selection operation; thereafter, the editing tool may obtain the rendering configuration parameters through the fabric material, and pass the rendering configuration parameters to the rendering tool through the corresponding interface of the rendering tool.
[0130] This solution provides a solution for users to set the fabric material of virtual fabrics by themselves. Users can set the fabric material of virtual fabric models according to actual needs, realizing flexible setting of fabric material.
[0131] In some embodiments, when the model file of the virtual fabric model includes description information of the fabric material, the above step 210 can be implemented as step 210a;
[0132] Step 210a: Obtain a fabric material that matches the fabric material description information from various materials supported by the rendering tool.
[0133] The computer device may run a rendering tool and development tools other than the rendering tool. During the development process, the developer user may pre-develop a virtual fabric model in the development tool. The model file may include model data and model information corresponding to the pre-developed virtual fabric model. For example, during the development process, the developer user sets the descriptive information of the fabric material; the development tool obtains the descriptive information of the fabric material and transmits the descriptive information of the fabric material to the rendering tool through the corresponding interface of the rendering tool; the rendering tool then determines the material that matches the descriptive information of the fabric material from among the various types of materials it supports, and uses the material as the fabric material of the virtual fabric model.
[0134] Exemplarily, the fabric material description information may be text information in a natural language format that describes the fabric material; for example, the fabric material description information may be the material name of a virtual fabric, such as "cotton," "silk," "leather," "nylon," and so on. In the process of determining the material that matches the description information, the computer device may calculate the semantic relevance between the material name of the virtual fabric and the names of various materials supported by the rendering tool to obtain the semantic relevance between the material name of the virtual fabric and the names of various materials supported by the rendering tool; and determine the material with the greatest semantic relevance among the various materials supported by the rendering tool as the fabric material that matches the fabric material description information.
[0135] Exemplarily, the fabric material description information may be data information in the form of digital parameters used to represent the fabric material; for example, the fabric material description information may be a fabric material number, and the computer device may have pre-set correspondences between fabric material numbers and various materials supported by the rendering tool. During the process of determining a material matching the description information, the computer device obtains the fabric material number, searches for the material corresponding to the fabric material number from the correspondences, and determines the found material as the fabric material of the virtual fabric model.
[0136] Based on the above embodiment, this embodiment proposes a scheme for obtaining fabric material based on the descriptive information of the fabric material contained in the model file. Among them, the development process and rendering process of the virtual fabric model are usually controlled or executed by different users at different stages; during the development process, the developer user of the virtual fabric model can set the descriptive information of the fabric material of the virtual fabric model in the model file during the development of the virtual fabric model; in the subsequent rendering process, the computer device can automatically filter out the material that matches the descriptive information of the fabric material from the materials supported by the rendering tool, without the need for the renderer to manually set the fabric material as the fabric material of the virtual fabric model; the above process of obtaining the fabric material of the virtual fabric model can be automatically executed by the computer device, and there is no need to manually select the fabric material during the rendering process. In addition to being applicable to offline rendering processes, it can also be applicable to online rendering processes, expanding the rendering scenarios of virtual fabric models.
[0137] In some embodiments, the above step 210a can be implemented as follows: obtaining the name of each material; the material name is the name of the material supported by the rendering tool; obtaining the similarity between each material name and the description information of the fabric material; determining at least two candidate materials from the materials corresponding to each material name in order of similarity from large to small; displaying preview information of at least two candidate materials, the preview information including the preview image and the material name; upon receiving a selection operation on the preview information of the target candidate material, obtaining the target candidate material as the fabric material that matches the description information of the fabric material; the target candidate material is one of the at least two candidate materials.
[0138] The above-mentioned acquisition of the similarity between each material name and the description information of the fabric material may include the following steps:
[0139] Feature extraction: Computer equipment performs feature extraction on the descriptive information, that is, extracting key feature words or phrases related to the material from the descriptive information of the fabric material as keyword groups for the descriptive information, such as "soft", "breathable", "natural fiber", "blended fabric", etc.
[0140] Vector conversion: The computer device performs semantic vector conversion on the keyword group of the description information and the material name corresponding to each material supported by the rendering tool to obtain corresponding semantic vectors, that is, obtaining a first vector corresponding to the keyword group of the description information and a second vector corresponding to the material name of each material supported by the rendering tool;
[0141] Similarity measurement: A similarity score between the first vector and the second vector is obtained by using a similarity or distance measurement method (such as cosine similarity). The higher the similarity score, the more similar the first vector and the second vector are.
[0142] Exemplarily, the rendering tool may correspond to a material library, which contains information such as the name and preview image of each material. The computer device may display preview information of the at least two candidate materials based on the material library.
[0143] Taking the computer device displaying preview information of five candidate materials as an example, the display interface of the preview information can be Figure 3 The interface shown in the figure is as follows. Figure 3 As shown, the material names of the five candidate materials are material name 1, material name 2, material name 3, material name 4, and material name 5. The computer device queries the preview images corresponding to the five candidate materials from the material library and selects them in the Figure 3 In the interface shown, a corresponding preview image is displayed above the material name of each candidate material; each candidate material may have one or more preview images. For example, different preview images of the same candidate material may correspond to different texture patterns.
[0144] The computer device may set a corresponding control in the area where the preview image of the candidate material is located, and the user may click or touch the control in the area where the preview image is located to select the candidate material corresponding to the preview image as the fabric material of the virtual fabric model. Figure 3 As shown, when the computer device receives a click or touch operation on the preview image 301 by the user, the candidate material corresponding to the preview image 301 is used as the fabric material of the virtual fabric model; for example, taking the virtual fabric model as a long skirt, the rendering effect of the virtual fabric model corresponding to the preview image 301 can be as follows Figure 4 shown.
[0145] Based on the above embodiments, this embodiment proposes a feasible solution for determining the materials supported by the rendering tool that match the description information. Specifically, during the rendering process, the computer device can automatically screen out candidate materials with a high degree of similarity to the description information of the fabric material from the materials supported by the rendering tool and display them to the user. The user selects one of them as the fabric material of the virtual fabric model. The user does not need to make a selection from all the materials supported by the rendering tool, which can significantly improve the efficiency of the user in determining the fabric material of the virtual fabric model from the materials supported by the rendering tool.
[0146] In some embodiments, the rendering attribute information may further include scene information, and the scene information is used to indicate the scene when rendering the virtual fabric model. Figure 2 Step 220 in the illustrated embodiment may be implemented as step 220a.
[0147] Step 220a: Obtain rendering configuration parameters based on the fabric material and scene information.
[0148] The scene when rendering the virtual fabric model may be related to the time, season, weather, light, temperature, humidity, terrain, altitude, etc. in the real world; for example, the scene may be dawn, dusk, rain, mist, underground, cliff, etc.
[0149] For example, the computer device may determine a scene for rendering the virtual fabric model based on scene information included in the rendering attribute information; the scene information may include a scene name or scene description information. For example, the scene information may include scene names such as sunny scene, rainy scene, and woodland scene, or description information such as the temperature, humidity, light source, and light intensity of the scene.
[0150] In virtual scenes with different light sources, virtual fabrics with the same fabric material usually correspond to different lighting, reflection, shadow, etc. Therefore, when obtaining rendering configuration parameters, the computer device can also refer to the scene when rendering the virtual fabric model.
[0151] In the embodiment of the present application, the computer device can obtain the rendering configuration parameters used by the rendering tool when rendering the virtual fabric model according to the fabric material and the scene information contained in the rendering attribute information of the virtual fabric model, thereby improving the accuracy of obtaining the rendering configuration parameters.
[0152] In some embodiments, the above step 220a can be implemented as step 220a1 or step 220a2.
[0153] Step 220a1: query the first rendering configuration parameters corresponding to the fabric material, and query the second rendering configuration parameters corresponding to the scene information, and obtain the first rendering configuration parameters and the second rendering configuration parameters as the rendering configuration parameters.
[0154] In the embodiment of the present application, the computer device can be pre-set with rendering configuration parameters corresponding to various fabric materials and scene information respectively; optionally, the type of rendering configuration parameters corresponding to the fabric material can be different from the type of rendering configuration parameters corresponding to the scene information. For example, the computer device can be pre-set with a first relationship table between various fabric materials and rendering configuration parameters respectively, and a second relationship table between various scene information and rendering configuration parameters respectively, and the type of rendering configuration parameters in the first relationship table is different from the type of rendering parameters in the second relationship table; the computer device can query the first relationship table through the fabric material of the virtual fabric model, query the above first rendering configuration parameters, and query the second relationship table through the scene information, query the above second rendering configuration parameters, and then combine the first rendering configuration parameters and the second rendering configuration parameters to obtain the rendering configuration parameters of the above virtual fabric model.
[0155] For example, the computer device can query and determine the first rendering configuration parameters such as transparency, glossiness, coloring model, sampling rate, shadow parameter, light chasing parameter according to the fabric material; the computer device can query and determine the second rendering configuration parameters such as light setting parameter, reflection parameter, refraction parameter according to the scene information, and then the computer device combines the first rendering configuration parameters and the second rendering configuration parameters to obtain the complete rendering configuration parameters.
[0156] For example, the relationship table between the above various fabric materials and scene information and the rendering configuration parameters can be as shown in Table 1 below.
[0157] Table 1
[0158]
[0159]
[0160] Step 220a2: Query the rendering configuration parameters corresponding to the combination of fabric material and scene information.
[0161] In an embodiment of the present application, the computer device may be pre-configured with rendering configuration parameters corresponding to various combinations of fabric materials and scene information. For example, a developer user may pre-configure a table of relationships between various combinations of fabric materials and scene information and rendering configuration parameters. For example, the table of relationships between various combinations of fabric materials and scene information and rendering configuration parameters may be as shown in Table 2 below.
[0162] Table 2
[0163]
[0164] For example, the computer device can obtain a scene material correlation between the fabric material and the scene information. When the scene material correlation between the fabric material and the scene information is lower than a first preset value, it indicates that the scene has little impact on the fabric material; in other words, factors such as the scene's lighting conditions, ambient reflections, and shadows have little impact on the realism and texture of the virtual fabric. The fabric material and scene information can each be used to determine some parameters of the rendering configuration parameters.
[0165] When the scene material correlation between the fabric material and the scene information is higher than a second preset value, it means that the scene has a greater impact on the fabric material; that is, factors such as the scene's lighting conditions, environmental reflections, and shadows have a greater impact on the realism and texture of the virtual fabric. The computer device can query and determine the rendering configuration parameters based on the combination of the fabric material and the scene information.
[0166] Based on the above embodiments, this embodiment proposes a feasible solution for obtaining rendering configuration parameters based on fabric material and scene information, which fully considers the relationship between fabric material and scene information and rendering configuration parameters respectively, and can improve the efficiency and accuracy of obtaining rendering configuration parameters.
[0167] For example, the user can manually set the scene information when rendering the virtual fabric model. For example, the user can set the scene when rendering the virtual fabric model in the settings interface of the editing tool, and the editing tool will generate the above scene information based on the scene corresponding to the user's operation. For another example, the user can enter the description information of the scene in the settings interface of the development tool, and the development tool will add the description information of the scene to the model file of the virtual fabric model as the above scene information.
[0168] In some embodiments, before the above step 220a, the method further includes: obtaining scene information of the virtual fabric model in response to a scene setting operation.
[0169] For example, a computer device may display a scene setting control in a rendering tool, and a user may use the scene setting control to select one or more scenes from various pre-set scenes. The computer device obtains the scene information corresponding to the user's selection operation as scene information of the virtual fabric model.
[0170] In some embodiments, the model file of the virtual fabric model includes description information of the scene when the virtual fabric model is rendered. Before the above step 220a, the following steps are also included:
[0171] In various scenes supported by the rendering tool, a scene matching the description information of the scene is obtained as the scene for rendering the virtual fabric model.
[0172] That is to say, the model file of the above-mentioned virtual fabric model can also be used to indicate the scene for rendering the virtual fabric model. The computer device can extract the description information of the scene from the model file. In the above-mentioned process of obtaining the scene that matches the description information of the scene, the computer device can calculate the semantic relevance between the description information of the scene of the virtual fabric model (such as the scene name) and the scene names of each scene supported by the rendering tool to obtain the semantic similarity between the scene name of the virtual fabric model and the scene names of each scene supported by the rendering tool; and determine the scene with the greatest semantic similarity among the scenes supported by the rendering tool as the scene that matches the description information of the scene.
[0173] In some embodiments, the “calling a rendering tool to create a virtual fabric model” in the above step 230 can be implemented as steps 230a and 230b.
[0174] Step 230a: Obtain a rendering data file; the rendering data file at least includes shape information of the virtual fabric model and extended information corresponding to the fabric material; the extended information includes one or more of the following: collision body parameters and physical property parameters.
[0175] For example, the computer device can obtain the model file of the virtual fabric model through a script program, and then obtain the rendering data file of the virtual fabric model based on the model file. For example, the computer device can add extended information to the model file to obtain the rendering data file.
[0176] For example, the shape information of the virtual fabric model may include mesh data of the virtual fabric model. The surface of the virtual fabric model may be composed of a plurality of meshes (e.g., triangular meshes) stitched together, and the mesh data may indicate the mesh of the virtual fabric model surface. For example, the mesh data may include data such as the positions of mesh vertices and normal vectors.
[0177] In some embodiments, the mesh data in the shape information may be included in a fabric mesh file in the shape information.
[0178] Optionally, the shape information may also include skeleton data.
[0179] Among them, the virtual fabric model can include one or more virtual bones, and the movement of the virtual fabric model can be driven by one or more virtual bones. Specifically, each mesh / mesh vertex in the virtual fabric model is bound to one or more virtual bones, and there is a pre-set positional relationship between the mesh / mesh vertex and the bound virtual bones; based on the above positional relationship, when the virtual bones move, they will drive the mesh / mesh vertex to move together, thereby reflecting the movement effect of the virtual fabric model.
[0180] The above-mentioned skeleton data may include data such as the position and three-dimensional spatial orientation of the above-mentioned one or more virtual skeletons.
[0181] In some embodiments, the skeleton data in the above-mentioned shape information may be included in a skeleton file in the shape information.
[0182] In some embodiments, the above-mentioned model file may also include animation sequence data, which may indicate dynamic information of the virtual fabric model, i.e., indicate the animation of the virtual fabric model; the computer device may obtain information on the shape, animation, etc. of the virtual fabric model based on the model file.
[0183] Exemplarily, the animation sequence data may be animation key frame data; wherein the animation key frame data is used to record key frame information at each time point during the virtual fabric simulation process, such as the time of each key frame and the corresponding animation data.
[0184] Taking the above-mentioned virtual fabric model as an example of a virtual character wearing virtual clothing, the animation key frame data may include the skeletal motion data corresponding to each time point (i.e., the above-mentioned key frame information); for example, the skeletal motion data may be used in combination with the above-mentioned skeletal data to indicate the position and spatial orientation of each virtual skeleton at each time point; for example, the above-mentioned skeletal motion data may include the position change information (such as displacement angle and displacement size) and three-dimensional spatial orientation change information (such as rotation direction and rotation angle) of each virtual skeleton relative to the previous time point at the corresponding time point. Starting from the position and three-dimensional spatial orientation of the virtual skeleton indicated by the above-mentioned skeletal data, combined with the skeletal motion data at the above-mentioned each time point, the position and three-dimensional spatial orientation of the virtual skeleton at each time point can be determined.
[0185] In some embodiments, the animation sequence data may be carried in a skeleton file, or the animation sequence data may be contained in other files other than the skeleton file.
[0186] A collision body is an invisible object in the virtual scene. The rendering tool can predefine how other objects interact with and interact with it. In fabric physics simulations, setting the correct collision body parameters can prevent virtual fabric from penetrating other objects and avoid unnatural interactions between the virtual fabric and other objects. Collision body parameters are crucial to the accuracy of fabric simulations. Incorrect collision body parameter settings can cause virtual fabric to interact incorrectly with other objects, affecting the quality of the fabric simulation.
[0187] The physical property parameters may include a series of parameters related to fabric physics simulation, which can be used to simulate and analyze the physical behavior of virtual fabrics under different conditions. For example, the physical property parameters correspond to the characteristics of the properties and behaviors exhibited by the virtual fabric under the action of forces. For example, in fabric physics simulation, the physical property parameters may include one or more of the following parameters related to physical properties:
[0188] Tensile parameters: describe the degree of deformation and strength of the virtual fabric when subjected to tension. For example, tensile parameters include tensile strength and tensile modulus.
[0189] Compression parameters: describe the degree of deformation and strength of the virtual fabric when subjected to pressure; for example, compression parameters include compression strength, compression modulus, etc.
[0190] Bending parameters: describe the deformation degree and strength of the virtual fabric when subjected to bending force; for example, bending parameters include bending stiffness, bending modulus, etc.
[0191] Friction parameters: describe the magnitude and characteristics of the friction between the virtual fabric and other objects. For example, friction parameters include friction coefficient, friction force, etc.
[0192] Mass parameter: describes the mass of the virtual fabric, usually expressed in mass units (such as grams);
[0193] Air resistance parameters: describe the magnitude and characteristics of the resistance encountered by the virtual fabric when it moves in the air; for example, air resistance parameters include air resistance coefficient, air resistance force, etc.
[0194] Step 230b: calling a rendering tool to generate a virtual fabric model based on the rendering data file.
[0195] In an embodiment of the present application, a computer device can obtain shape information of a virtual fabric model, extended information corresponding to the fabric material, and the like based on the above-mentioned rendering data file, and then, in a rendering tool, create a virtual fabric model corresponding to the rendering data file according to the obtained shape information, extended information corresponding to the fabric material, and other information. For example, the virtual fabric model can have a shape indicated by the above-mentioned shape information, as well as a collision body and physical properties indicated by the above-mentioned extended information.
[0196] Based on the above embodiments, the above embodiments of the present application expand the information of the virtual fabric model such as the collision body and physical properties, so that the virtual fabric model constructed by the rendering tool has a more accurate dynamic effect, thereby improving the accuracy of the virtual fabric model construction.
[0197] Exemplarily, a computer device can call a data loading interface of a rendering tool to load a rendering data file into the rendering tool. The rendering tool can then use the loaded rendering data file to create a virtual fabric model corresponding to the rendering data file. Simultaneously, the computer device can also call a parameter setting interface of the rendering tool to pass rendering configuration parameters to the rendering tool, thereby automatically setting the rendering configuration parameters in the rendering tool. The rendering tool can then render the virtual fabric model using the rendering configuration parameters to obtain at least one rendered image of the virtual fabric model. This process eliminates the need for the user to manually set various rendering configuration parameters in the rendering tool, thereby improving rendering efficiency and supporting scenes that require automatic rendering.
[0198] In some embodiments, the above step 230a can be implemented as step 230a1, step 230a2 and step 230a3.
[0199] Step 230a1: Loading a model file of a virtual fabric model; the model file at least includes shape information.
[0200] Exemplarily, the model file may include a fabric mesh file and a skeleton file, wherein the skeleton file is optional. The computer device may load the fabric mesh data based on the fabric mesh file by filling the fabric mesh two-dimensional mapping data into the byte file; correspondingly, the computer device may also load the skeleton data based on the skeleton file.
[0201] Step 230a2: Acquire extended information data, where the extended information data is used to indicate extended information.
[0202] Exemplarily, the extended information data includes one or more of the following: collision body setting data and physical property setting data; wherein the collision body setting data is used to indicate collision body parameters, and the physical property setting data is used to indicate physical property parameters.
[0203] Step 230a3: Serialize the model file and the extended information data to generate a rendering data file.
[0204] The above-mentioned serialization refers to the process of converting the model file and the extended information data into a file in a specified format; that is, the format of the rendering data file can be a custom format.
[0205] For example, taking the example of extended information data including collision body setting data and physical property data, the computer device can serialize the model file, collision body setting data and physical property data by running a script program (such as an editor program), and convert the model file, collision body setting data and physical property data into a binary file in a custom format that can be stored or transmitted.
[0206] Optionally, the computing device can also introduce new data types or attributes to handle more complex fabric properties, such as fracture, damage simulation, etc.
[0207] Based on the above embodiments, the embodiments of the present application propose a feasible solution for obtaining rendering data files based on the model files of the virtual fabric model. By serializing the model files and extended information data, rendering data files in a custom format are generated, which can efficiently compress the rendering data files while ensuring the accuracy and availability of the rendering data files.
[0208] In some embodiments, the above step 230a2 can be implemented as step 230a-1 or step 230a-2.
[0209] Step 230a-1: Receive an extended setting operation, and obtain extended information data based on the extended setting operation.
[0210] That is, the computer device can provide the user with permission to set the extended information corresponding to the fabric material, so that the user can set the extended information corresponding to the fabric material in the editing tool. For example, the computer device can display an extended setting control in the editor of the terminal device so that the user can trigger the extended setting operation.
[0211] For example, the user may select one or more of various preset candidate extended information as the extended information through the extended setting control; and the computer device obtains the extended information data according to the user's selection operation.
[0212] In some embodiments, the above-mentioned extended setting operation includes at least one of a collision body setting operation and a physical property setting operation.
[0213] In the case where the extended operation includes a collision body setting operation, the computer device may obtain collision body setting data corresponding to the collision body setting operation based on the received collision body setting operation. For example, the computer device may provide a collision body setting interface in which the user may set the collision body, for example, setting collision body parameters such as the shape and size of the collision body.
[0214] When the extended operation includes a physical property setting operation, the computer device may also obtain physical property data corresponding to the received physical property setting operation. For example, the computer device may provide a physical property setting interface, where the user can set physical property parameters such as the values of various physical properties in the collision body setting interface.
[0215] Step 230a-2: Query the extended information data corresponding to the fabric material.
[0216] In an embodiment of the present application, extended information data corresponding to various fabric materials may be pre-set in the computer device, and the computer device may query the corresponding extended information data according to the fabric material of the virtual fabric model.
[0217] For example, a developer user pre-sets a relationship table between fabric material and extended information data. When obtaining extended information data, the computer device can query the corresponding extended information data according to the fabric material of the virtual fabric model.
[0218] Based on the above embodiments, the embodiments of the present application propose a solution for how to obtain extended information data, which can support users to customize the extended information data before rendering, improve the flexibility of obtaining extended information data, and also support automatic acquisition of corresponding extended information data according to fabric material, thereby improving the efficiency of obtaining extended information data.
[0219] In some embodiments, the shape information includes a fabric mesh file, and the fabric mesh file is used to indicate the mesh of the virtual fabric model; when the extended information includes physical property parameters, the above step 220a can be implemented as follows: loading the fabric mesh file;
[0220] The virtual fabric rendering method further includes: setting a mapping relationship between the mesh of the virtual fabric model and the physical property parameters based on the fabric mesh file; the mapping relationship is used to create a virtual fabric model with the physical property parameters.
[0221] In the embodiment of the present application, the above-mentioned shape information may also include mesh information of the virtual fabric model.
[0222] For example, the computer device may map the physical properties corresponding to the physical property data to the respective vertices corresponding to the meshes of the virtual fabric model. For example, the computer device may display a physical property to mesh mapping interface, through which the user may select the physical properties to be mapped to each group of meshes / mesh vertices in the virtual fabric model. For example, the user may select a group of meshes on the mapping interface and set the physical properties such as mass and elasticity corresponding to the selected meshes / mesh vertices. The computer device then automatically establishes a mapping relationship between the user-selected meshes / mesh vertices and the corresponding physical properties.
[0223] Based on the above embodiments, the above embodiments of the present application propose a feasible solution for setting the mapping relationship between grids and physical property data in the rendering data file of the virtual fabric model, so that the computer device can set the physical properties of each grid in the virtual fabric model, thereby improving the setting accuracy of the physical property parameters of the virtual fabric model, and thereby improving the rendering effect of the virtual fabric model by subsequent rendering tools.
[0224] For example, the model file can be an FBX file of a virtual clothing model, and the rendering data file can be a file obtained by a computer device through a script program based on the FBX file. The rendering data file can also be called an offline fabric data file. Figure 5 , which shows a schematic diagram of a rendering data file provided by an exemplary embodiment of the present application.
[0225] like Figure 5 As shown, first, the computer device generates a custom-formatted fabric mesh (ClothMesh) file 502, a skeleton (Skeleton) file 503, and an animation (Animation) file 504 through code based on the FBX file 501. Among them, the fabric mesh file 502 is used to store the mesh information of the virtual fabric; for example, the fabric mesh file contains the position information of the vertices that make up the mesh (such as the coordinates of the vertices), and the model surface of the virtual fabric can be composed of one or more meshes. The skeleton file 503 is used to store the skeletal structure information of the virtual character; such as the name, length, volume, position, index and other information of the virtual skeleton. The animation file 504 is used to store the key frame data of the fabric animation; for example, the animation file includes the skeletal movement data corresponding to each time point. Through the fabric mesh file, skeleton file, and animation file, the computer device obtains the dynamic change effect of the virtual fabric.
[0226] in, Figure 5The .h & .cpp in the file are the file extensions of C++ source code files, which are used to store class declarations and definitions; structures are used to organize and store different types of data; setters are used to set or modify the values of class member variables; getters are used to get the values of class member variables.
[0227] The computer device then loads the animation file 504 as animation data (AnimDatas) 505 and the skeleton file 503 as skeleton data (SkeletonDatas) 506. Based on the bff-command.exe file, the fabric mesh file 502 is populated with the fabric mesh two-dimensional mapping data into a byte file (for example, mapping the fabric mesh onto a two-dimensional plane) to load the fabric mesh data (ClothMeshDatas) 507. This process can be executed using bff-command.exe (an executable file used to execute specific commands or operations). The animation data 505 is used to store various animation data, such as keyframe data and curve data; the skeleton data 506 is used to store various skeleton data, such as bone structure information and bone index data. The fabric mesh data 507 is used to store fabric mesh information, such as vertex positions, vertex indices, UV data, normal data, etc.
[0228] Then, the computer device loads the collision body setting data (CollisionDatas) 508 (i.e., the above-mentioned collision body parameters) and the fabric configuration data (ClothConfigDatas) 509 (i.e., the physical property parameters) based on the collision body setting operation (Collision Editing) and the fabric configuration information setting operation (Cloth Config Editing) (i.e., the above-mentioned physical property setting operation); the collision data is used to store relevant data of collision detection and collision response, for example, the collision body setting data 508 can be relevant data of collision detection and collision response; the fabric configuration data 509 is used to store relevant configuration parameters of fabric simulation.
[0229] Exemplarily, the collision body setting operation may include: creating or selecting a collision body on a 3D model; adjusting the size and shape of the collision body as needed to ensure that the collision body is close to the actual model but does not overlap with the actual model; specifically, for example, the above-mentioned collision body setting operation may include setting collision parameters, such as elasticity, friction, and strength, etc.
[0230] Fabric configuration information contains a series of physical parameters related to fabric physics simulation, such as stretch, compression, bending, friction, mass, and air resistance. This fabric configuration directly affects how the fabric interacts with other objects in the scene, as well as its own behavior. Different parameter settings will lead to different simulation results.
[0231] Exemplarily, the fabric configuration information setting operation may include: in the fabric physical property setting, specifying the values of various physical parameters, and adjusting the above physical parameters according to the fabric material (such as cotton, silk, denim) to achieve the most suitable physical response.
[0232] The computer device can also fill the fabric mesh data 507 by painting cloth, creating a mapping, etc. Painting cloth refers to the process of painting fabric properties in a physical editor, which essentially maps specific physical properties to each mesh / mesh vertex of the fabric model.
[0233] For example, the fabric painting process can include: selecting some vertices or patches on the virtual fabric model; and using fabric painting tools to adjust the physical properties of these vertices or patches, such as mass, elasticity, and friction coefficient. This allows users to precisely control the behavior of each part of the fabric, making the virtual fabric exhibit varying degrees of bending, stretching, tearing resistance, and other properties in the simulation.
[0234] For example, the mapping process described above corresponds to setting the relationship between a high-precision rendering mesh and a low-precision physical mesh. In game development, especially when dealing with fabric simulations, it is necessary to find a balance between visual performance (high-precision rendering mesh) and computational efficiency (low-precision physical mesh). For example, mesh-to-mesh skinning can be used to create the mapping.
[0235] Finally, the computer device serializes the collision body setting data 508 , the fabric configuration data 509 , the fabric mesh data 507 , and the skeleton data 506 to obtain an exported fabric binary file 510 , namely, an offline fabric data file.
[0236] In some embodiments, the above step 230b also includes steps 222 and 224 before step 230b.
[0237] Step 222: Based on the fabric material, select a pre-processing method; pre-processing includes one or more of the following processing methods: data cleaning, denoising, smoothing, format conversion, level of details (LOD) setting, and collision volume optimization.
[0238] Step 224: Process the rendering data file based on the pre-processing method to obtain a pre-processed rendering data file.
[0239] The above step 230b can be implemented as follows:
[0240] The rendering tool is called to generate a virtual fabric model based on the pre-processed rendering data file.
[0241] The above-mentioned preprocessing is an optimization operation on the rendering data file before rendering begins, which can improve the accuracy of the rendering data file.
[0242] The following describes the above-mentioned preprocessing methods:
[0243] 1) Data cleaning can include checking the rendering data file for inconsistencies, errors, or incomplete information. Data cleaning ensures that the rendering data file used in the fabric simulation is accurate and reliable, thereby reducing rendering errors and improving simulation quality when subsequently rendering a virtual fabric model using the rendering data file. For example, data cleaning can be used to remove anomalies in the rendering data file, repair missing data in the rendering data file, correct formatting errors in the rendering data file, and so on.
[0244] 2) The above denoising can remove high-frequency noise in the rendering data file, avoiding unrealistic visual artifacts during rendering.
[0245] 3) The data smoothing mentioned above can smooth the vertex data of the virtual fabric model contained in the rendering data file to reduce abrupt edges or folds in the virtual fabric model.
[0246] 4) The above-mentioned detail level adjustment can create different detail levels for the virtual fabric model; this detail level can be used to optimize game performance. For example, the rendering tool can adjust the rendering accuracy of the virtual fabric model in real time based on the detail level of the virtual fabric model while ensuring the user's visual experience. This can significantly reduce the burden on the rendering tool and improve the rendering efficiency of the rendering tool.
[0247] 5) Format conversion, as mentioned above, can refer to converting data from one format to another, ensuring data compatibility across different software and tools, enabling seamless workflows and more flexible data management. For example, a computer device can convert rendering data files from one 3D software format to another suitable for the rendering tool.
[0248] 6) The above-mentioned collision body optimization may be to optimize the size or shape of the collision body. For example, the collision body optimization may simplify the geometric shape of the collision body in the rendering data file to ensure that the collision detection process does not consume excessive computing resources.
[0249] Based on the above embodiments, the above embodiments of the present application propose a solution for optimizing the rendering data file before rendering the virtual fabric model. By preprocessing the rendering data file such as cleaning, denoising, and smoothing, the accuracy of the rendering data file can be improved, and unnecessary data content in the rendering data file can be reduced, thereby reducing the complexity of subsequent rendering of the virtual fabric model and improving the quality of the rendered image.
[0250] Exemplarily, in the above-mentioned process of selecting a preprocessing method based on fabric material, the computer device may pre-set the correspondence between various fabric materials and various preprocessing methods; before performing preprocessing on the rendering data file, the computer device may query the above-mentioned correspondence through the fabric material of the virtual fabric model to obtain the corresponding preprocessing method.
[0251] For example, consider linen and silk. Linen wrinkles easily, and the resulting wrinkles will appear uneven. For linen, the computer can perform preprocessing on the corresponding rendering data file, including data cleaning, denoising, LOD setting, and collision optimization, instead of smoothing the data. This is done to preserve wrinkle-related data within the rendering data file. Because silk is lighter and softer, wrinkles are less visible. Therefore, the computer can perform preprocessing on the corresponding rendering data file, including smoothing, to avoid undesirable wrinkle-related data within the rendering data file.
[0252] The above-mentioned solution of selecting a pre-processing method based on fabric material enables a computer device to select an accurate pre-processing method based on different fabric materials, thereby improving the accuracy of pre-processed rendering data files.
[0253] In some embodiments, the above Figure 2 The solution shown may further include step 240 and step 250 .
[0254] Step 240: based on the fabric material, a processing mode of post-processing is selected; the post-processing includes one or more of the following processing modes: color adjustment and visual effect enhancement.
[0255] Step 250: based on the processing mode of post-processing, at least one frame of rendered picture is processed.
[0256] In the embodiments of the present application, post-processing is performed on at least one frame of rendered picture, which can optimize and update the above-mentioned rendered picture. Among them, the post-processing can improve the visual quality of the virtual fabric in the rendered picture, enhance or change the visual effect of the image; for example: the computer device can perform post-processing on the rendered picture through image optimization algorithm to enhance the texture and detail performance of the virtual fabric in the rendered picture.
[0257] The following describes several processing modes of the above-mentioned post-processing:
[0258] 1) The computer device can perform color correction post-processing on the rendered picture to adjust the color balance, contrast, brightness, etc. of the rendered picture, and enrich the image color of the rendered picture.
[0259] 2) The computer device can perform visual effect enhancement post-processing on the rendered picture; specifically, for example, the computer device applies various visual effect filters (such as depth of field blur, halo, dark corner, etc.) to process the rendered picture to improve the overall visual aesthetics of the rendered picture.
[0260] In some embodiments, the computer device can integrate multiple frames of rendered pictures after post-processing into an animation sequence.
[0261] Based on the above-mentioned embodiments, the above-mentioned embodiments of the present application propose a scheme of optimizing the rendered picture after the rendering tool generates the rendered picture, which can improve the quality of the rendered picture of the virtual fabric through color adjustment, visual effect enhancement and other post-processing of the rendered picture, and thus provide high-quality rendering output while ensuring rendering efficiency.
[0262] For example, in the above-mentioned process of selecting a post-processing mode based on the fabric material, the computer device can be pre-set with a corresponding relationship between various fabric materials and various post-processing modes, and before performing the above-mentioned post-processing, the computer device can query the corresponding post-processing mode through the fabric material of the virtual fabric model.
[0263] The above-mentioned scheme enables the computer device to select an accurate post-processing mode based on different fabric materials, thereby improving the accuracy of post-processing of the rendered picture.
[0264] The above-mentioned pre-processing and post-processing are two links in the rendering process shown in this application, which are located before and after rendering respectively, and can optimize the final rendering effect without affecting the rendering time.
[0265] Please refer to Figure 6 , which shows a schematic diagram of a virtual fabric rendering system framework provided by an exemplary embodiment of the present application, such as Figure 6 As shown, the computer device in the framework mainly includes three tools, namely a virtual fabric model development tool 601, an editing tool 602, and a rendering tool 603.
[0266] First, a developer can develop a virtual fabric model using a development tool 601 and output a model file 610 (e.g., an FBX file) of the virtual fabric model. The model file 610 can indicate the shape and animation of the virtual fabric model; for example, the model file 610 includes a fabric mesh file 610a, a skeleton file 610b, and an animation file 610c.
[0267] Next, the developer can input the model file 610 into the editing tool 602. The editing tool 602 generates a rendering data file 620 based on the model file in conjunction with the user's editing / setting operations. The rendering data file 620 can indicate the shape, animation, collision body, and physical properties of the virtual fabric model; for example, the rendering data file 620 includes collision data 620a, fabric configuration data 620b, fabric mesh data 620c, and skeleton data 620d.
[0268] Then, the computer device can determine rendering configuration parameters 630 based on the fabric material and scene information. The rendering configuration parameters 630 include color, transparency, glossiness, lighting setting parameters, reflection parameters, refraction parameters, shading model, sampling rate, shadow parameters, ray tracing parameters, etc. The function of determining the rendering configuration parameters 630 can be integrated into the editing tool 602 or the rendering tool 603; or, the function of determining the rendering configuration parameters 630 can be set in other data processing tools (such as plug-ins) outside the editing tool 602 and the rendering tool 603 (not shown in the figure).
[0269] Finally, the rendering tool 603 renders multiple frames of rendering images 640 according to the rendering data file 620 and the rendering configuration parameters 630 , and then the computer device integrates the multiple frames of rendering images 640 into an animation sequence 650 to obtain a complete fabric simulation animation effect.
[0270] Among them, the solutions shown in the above embodiments of the present application can be applied to various scenarios that require simulating the visual effects of fabric models, such as game development, film and television production, and fashion design.
[0271] For example, in a game development scenario, the solution shown in the above embodiment can be used to pre-render an animation of a virtual fabric model offline as the Ground Truth. The virtual fabric model is a virtual clothing model of a virtual object wearing virtual clothing in the game, the fabric material is the clothing material of the virtual clothing, and the fabric mesh file is the clothing mesh file of the virtual clothing model. Please refer to Figure 7 , which shows a flowchart of a method for rendering virtual clothing provided by an exemplary embodiment of the present application, such as Figure 7 As shown, the process may include the following steps:
[0272] Step 710: Obtain rendering attribute information of the virtual clothing model, where the rendering attribute information includes clothing material. The virtual fabric model at least includes a model portion corresponding to the fabric, and the fabric material is the material of the model portion corresponding to the fabric.
[0273] Step 720: Obtain rendering configuration parameters based on the rendering attribute information; the rendering configuration parameters are configuration parameters used when rendering the virtual clothing model.
[0274] Step 730: calling a rendering tool to create a virtual fabric model, and setting rendering configuration parameters in the rendering tool so that the rendering tool renders the virtual clothing model based on the rendering configuration parameters to obtain at least one frame of rendered image.
[0275] Optionally, the rendering attribute information further includes scene information, which is used to indicate the scene when rendering the virtual clothing model. The above step 720 can be implemented as the following steps:
[0276] Step 720a: Obtain rendering configuration parameters based on clothing material and scene information.
[0277] Optionally, the above step 720a may be implemented as the following steps:
[0278] Query the first rendering configuration parameter corresponding to the clothing material, and query the second rendering configuration parameter corresponding to the scene information, and obtain the first rendering configuration parameter and the second rendering configuration parameter as the rendering configuration parameter; or query the rendering configuration parameter corresponding to the combination of the clothing material and the scene information.
[0279] Optionally, the above step 710 may be implemented as the following steps: in response to the material setting operation, obtaining the clothing material of the virtual clothing model.
[0280] Optionally, when the model file of the virtual clothing model includes description information of clothing materials, the above step 710 can be implemented as the following steps:
[0281] Step 710a: Obtain a clothing material that matches the description information of the clothing material from various materials supported by the rendering tool.
[0282] Optionally, the above step 710a can be implemented as: obtaining the name of each material; the material name is the name of the material supported by the rendering tool; obtaining the similarity between each material name and the description information of the clothing material; determining at least two candidate materials from the materials corresponding to each material name in order of similarity from large to small; displaying preview information of at least two candidate materials, the preview information including the preview image and the material name; upon receiving a selection operation on the preview information of the target candidate material, obtaining the target candidate material as the clothing material that matches the description information of the clothing material; the target candidate material is one of the at least two candidate materials.
[0283] Optionally, the “calling a rendering tool to create a virtual fabric model” in step 730 may be implemented as the following steps:
[0284] Step 730a: Obtain a rendering data file; the rendering data file contains at least shape information of the virtual clothing model and extended information corresponding to the clothing material; the extended information includes one or more of the following: collision body parameters and physical property parameters.
[0285] Step 730b: Calling a rendering tool to generate a virtual clothing model based on the rendering data file.
[0286] Optionally, the above step 730a may be implemented as the following steps:
[0287] Step 730a1: Load the model file of the virtual clothing model; the model file at least contains shape information.
[0288] Step 730a2: Acquire extended information data, where the extended information data is used to indicate extended information.
[0289] Step 730a3: Serialize the model file and the extended information data to generate a rendering data file.
[0290] Optionally, the above step 730a2 may be implemented as the following steps:
[0291] An extended setting operation is received, and extended information data is acquired based on the extended setting operation; or, extended information data corresponding to clothing material is queried.
[0292] Optionally, the shape information includes a clothing mesh file, which is used to indicate the mesh of the virtual clothing model; in the case where the extended information includes physical attribute parameters, the above step 730a1 can be implemented as the following steps: loading the clothing mesh file;
[0293] The rendering method of the virtual clothes further includes: setting a mapping relationship between a mesh of the virtual clothes model and the physical attribute parameters based on the clothes mesh file; and the mapping relationship is used to create the virtual clothes model with the physical attribute parameters.
[0294] Optionally, before the step 730b, the method further includes the following step:
[0295] Step 722: selecting a pre-processing mode based on the fabric material; the pre-processing includes one or more of the following processing modes: data cleaning, denoising, data smoothing, format conversion, detail level adjustment LOD setting, and collision body optimization.
[0296] Step 724: processing the rendering data file based on the pre-processing mode to obtain a pre-processed rendering data file.
[0297] The step 730b can be implemented as the following step:
[0298] The rendering tool is called to generate a virtual fabric model based on the pre-processed rendering data file.
[0299] Optionally, the rendering method of the virtual clothes further includes:
[0300] Selecting a post-processing mode based on the fabric material; the post-processing includes one or more of the following processing modes: color adjustment and visual effect enhancement.
[0301] Processing at least one frame of rendering picture based on the post-processing mode.
[0302] Based on the above embodiments, in the game development scenario, the animation of the virtual clothes model is pre-rendered offline as Ground Truth, for example, please refer to Figure 8 which shows a rendering process of virtual clothes provided by an example embodiment of the present application, and the specific process is as follows:
[0303] Step 801: obtaining virtual clothes data: the user can import the FBX file of the virtual clothes model into the computer device (such as an offline editor) to obtain virtual clothes data; wherein the virtual clothes data includes animation data, collision body parameters, physical attribute parameters, and clothes mesh data.
[0304] For example, first, the offline editor generates a clothes mesh file, a skeleton file, and an animation file based on the FBX file through code; then loads the clothes mesh data based on the clothes mesh file, loads the skeleton data based on the skeleton file, and loads the animation data based on the animation file. Second, the offline editor creates collision body parameters based on collision body setting operations and edits physical attribute parameters based on physical attribute setting operations.
[0305] To achieve better rendering results, the computer device sets the sub-iteration number to a larger value, such as 128. The sub-iteration number refers to the number of additional iterations performed within each simulation time step. By increasing the sub-iteration number, the motion and collision behavior of the clothing can be simulated more accurately. When the sub-iteration number increases, the simulation time step is subdivided into smaller time intervals. This means that each sub-iteration will simulate the clothing's position, velocity, and acceleration, as well as the constraints between the clothing (such as collision constraints, joint constraints, etc.), in smaller time intervals. Through multiple sub-iterations, the position and shape of the clothing can be gradually adjusted to meet the constraints and physical laws.
[0306] When the set sub-iteration number is reached, the physical simulation process terminates, and the final simulation result is obtained. Increasing the sub-iteration number can improve the accuracy and stability of the physical simulation, especially when dealing with self-collision and capsule collision detection, which can make collision detection more frequent, thereby reducing the interval between self-collision and capsule collision. This can better avoid the phenomenon of clothing penetrating other objects, i.e., part or all of the clothing penetrating other objects. At the same time, increasing the sub-iteration number can also reduce the phenomenon of clothing flying, i.e., the clothing appearing unstable motion or position during the simulation process.
[0307] That is, sub-iteration can be seen as a more granular division of the physical simulation process, which approximates the real physical behavior through multiple iterations. By increasing the sub-iteration number, the simulation process is more accurate, and the motion and collision effect of the clothing is more realistic. Therefore, by adjusting the sub-iteration number, higher accuracy and stability can be achieved in the physical simulation process.
[0308] Step 802, obtaining an offline clothing data file: serializing the collision body parameters, physical property parameters, and clothing mesh data in the simulation clothing data into an offline clothing data file in a custom format, such as OfflineClothData.od.
[0309] For example, the offline clothing data file mainly contains the following data:
[0310] Vertex position: the vertex position is the position information of each vertex of the virtual clothing model corresponding to each mesh at different time steps in the clothing simulation process. By recording the position of each vertex at each time step, the dynamic change process of the virtual clothing can be restored. The vertex position can be represented by three-dimensional coordinates, such as (x, y, z).
[0311] Vertex Index: Vertex Index is used to determine which vertices of the virtual garment model are connected in the garment simulation process, and the connected vertices form triangular patches. By recording the vertex index of each triangular patch, the geometry of the virtual garment can be reconstructed. The vertex index can be represented by an integer, for example, (0, 1, 2) represents a triangular patch composed of vertices 0, 1 and 2.
[0312] UV Data: UV data is used to determine the coordinate position of each vertex in the texture map during the garment simulation process. By recording the UV coordinates of each vertex, the application can map the texture map to the virtual garment surface during rendering, achieving the effect of texture fitting. The UV data can be represented by two-dimensional coordinates, for example, (u, v).
[0313] Normal Data: Normal data is used to determine the normal direction of each vertex during the garment simulation process. By recording the normal of each vertex, the application can achieve the simulation of real light effect during rendering, making the shadow and highlight of the virtual garment surface more realistic. The normal data can be represented by a three-dimensional vector, for example, (nx, ny, nz).
[0314] Weight Data: Weight data is used to determine the degree of association between each vertex and the bone or other animation controller during the garment simulation process. By recording the weight value of each vertex and each bone or animation controller, the application can achieve the deformation effect of the garment during animation. The weight data can be represented by a set of weight values, for example, (w1, w2, w3...wn).
[0315] Skeleton Index Data: Skeleton index data is used to determine which bones or animation controllers affect each vertex during the garment simulation process. By recording the index value of each vertex and the bone or animation controller, the position and deformation of the vertex can be accurately calculated during animation through the skeleton index data. The skeleton index data can be represented by an integer index, for example, (s1, s2, s3...sn).
[0316] Animation Keyframe Data: Animation keyframe data is used to record the keyframe information of each time step during the garment simulation process. By recording the time point and corresponding animation data of each keyframe, the dynamic effect of the virtual garment can be accurately restored when playing the animation. The animation keyframe data can include vertex position, normal direction, weight value, etc.
[0317] Step 803, Material Adjustment and Optimization: In terms of material processing of rendering tools, the computer device can adjust and optimize the garment material of the virtual garment model as needed to better present the texture, lighting and reflection effects of the virtual garment model, and improve the rendering quality.
[0318] In some embodiments, the computer device can perform one or more of the following adjustments or optimizations on the virtual clothing model based on the rendering configuration parameters:
[0319] Texture mapping: applying texture maps to the surface of the virtual clothing model to achieve realistic texture effects; for example, the computer device can map texture images onto the UV coordinates of the virtual clothing model to ensure that the texture accurately fits the surface of the virtual clothing;
[0320] Parameter adjustment: adjusting corresponding parameters such as color, transparency, reflectivity, glossiness, etc. according to the characteristics and expected effects of the virtual clothing model, to improve the realism of the appearance of the virtual clothing model;
[0321] Lighting settings: setting the lighting of the virtual clothing model, including adjusting the position, intensity, color, etc. of the light source; through reasonable lighting settings, the virtual clothing model can present more accurate shadow, highlight, reflection effects, etc. in rendering;
[0322] Reflection and refraction: adjusting the reflection and refraction effects of the virtual clothing model to simulate the reflection and transmission of light on the surface of the virtual clothing model; by adjusting the parameters of reflection and refraction, the realism of the optical effects presented by the virtual clothing model in rendering can be improved;
[0323] Shading model selection: selecting a suitable shading model from the relationship table between clothing materials and scene and rendering configuration parameters according to the characteristics and needs of the clothing material of the virtual clothing model, such as Lambertian shading model, Phong shading model, Blinn-Phong shading model, etc.; each shading model has different lighting and reflection calculation methods, and the computer device can select a suitable model according to the actual situation of the clothing material and / or scene;
[0324] Rendering quality optimization: when adjusting and optimizing the virtual clothing model, the optimization of rendering quality needs to be considered, including adjusting the sampling rate, shadow parameters, light tracing depth, etc. to balance the rendering quality and rendering time; through reasonable optimization, the rendering speed of the rendering tool can be improved, while ensuring that the rendering tool outputs high-quality rendering images.
[0325] For example, the above adjustment or optimization process of the virtual clothing model can include the following steps:
[0326] S1, data deserialization: extracting vertex data (such as vertex position, vertex index, UV data, etc.) and animation keyframe data from OfflineClothData.od and providing them to the rendering pipeline to obtain animation frame data after offline physical simulation;
[0327] S2, determining clothing material: determining clothing materials supported by the rendering tool according to user settings or description information of clothing materials in OfflineClothData.od;
[0328] S3, adjust texture parameters: import clothing texture map, and adjust the texture parameters such as scale, offset, rotation, etc. to ensure that the map fits the model correctly;
[0329] S4, setting reflectivity and glossiness: adjusting the reflectivity and glossiness parameters of the clothing material according to the characteristics of the clothing material to reflect the light reflection and absorption characteristics of different clothing materials;
[0330] S5, optimize global lighting effects: use the global illumination technology of the rendering tool to adjust the light source, ambient light and other settings to ensure that the lighting conditions of the virtual clothing meet the scene requirements;
[0331] S6, Preview and Iteration: After completing the preliminary settings, perform a rendering preview and continue to optimize the material parameters according to the preview effect until a satisfactory effect is achieved.
[0332] Step 804: Single-frame offline rendering: Offline rendering is performed in a rendering tool. The rendering tool renders the virtual clothing model frame by frame and exports an image of each frame. By using the rendering tool's rendering technology and global illumination functions, the rendered image can present a high-quality cloth simulation rendering effect.
[0333] Exemplarily, the steps of performing offline rendering in a rendering tool may include the following implementation process:
[0334] Create scene: Create or import scenes for virtual clothing model rendering, including adding virtual clothing, setting camera angles, adjusting scene layout, etc.
[0335] Material and texture settings: Use the rendering tool's material and texture settings interface (Application Programming Interface, API) to assign different clothing materials and textures to the virtual clothing in the scene; adjust the properties of the clothing material, such as color, reflectivity, transparency, etc., as needed;
[0336] Set up light sources: Use the rendering tool's light source setting API to add light sources and set their properties, such as their position, color, and intensity. Depending on the scene requirements, you can add different types of light sources, such as point light sources, parallel light sources, and ambient light.
[0337] Set up the camera: Use the camera setting API of the rendering tool to create a camera and set the camera's position, rotation, focal length and other parameters. Adjust the camera parameters to obtain the desired perspective and depth of field effect.
[0338] Render settings: Set the parameters for rendering, such as resolution, frame rate, sampling rate, etc.
[0339] Start rendering: Call the rendering function or API of the rendering tool to start rendering; such as passing the scene, camera, light source, etc. Parameters to the rendering function, and specifying the frame range and frame rate of rendering;
[0340] Complete rendering: Use the API of the rendering tool to save the rendering result as an image file.
[0341] Step 805, multi-frame offline rendering: Repeat step 804 to obtain multi-frame rendering pictures. For example, multi-frame offline rendering includes the following steps:
[0342] Automated rendering script: Control the rendering process through a script to automatically render each frame in the animation sequence of the entire virtual clothing;
[0343] Detect rendering progress: Detect the rendering process to ensure that each frame is rendered as expected;
[0344] Render completion confirmation: After all frames are rendered, perform quality checks to ensure the coherence and quality of all rendered frames.
[0345] Step 806, obtain animation sequence: The computer device integrates the multi-frame rendering pictures into an animation sequence through a script program to obtain a complete clothing simulation animation effect. For example, the computer device can use Python language and OpenCV library to realize the function of combining multiple pictures into a video.
[0346] For example, the process of integrating the multi-frame rendering pictures into an animation sequence described above can include the following steps:
[0347] Image post-processing: Perform necessary color correction, brightness adjustment, and post-effect application on each rendered frame;
[0348] Video combination: Use video editing software or scripts to combine single-frame pictures into a video file according to the correct frame rate and order;
[0349] Format conversion and compression: Convert the generated video to the required format and compress it for easy transmission and storage;
[0350] Final verification: Play the synthesized video file to check the smoothness and visual effect of the animation, ensuring that the final output meets the design requirements.
[0351] For example, the process of integrating the multi-frame rendering pictures into an animation sequence described above can include the following implementation process:
[0352] 1) Import the required libraries:
[0353] import cv2: Import OpenCV library for processing images and videos;
[0354] import os: import the os library for processing files and folders;
[0355] 2) Set the image folder path and output video file name:
[0356] image_folder = 'path / to / images': Set the image_folder variable to the path of the folder where the images are stored;
[0357] video_name = 'output_video.mp4': sets the video_name variable to the output video file name;
[0358] 3) Get all the image file names in the image folder:
[0359] images=[img for img in os.listdir(image_folder)if img.endswith(".jpg")]: Use list deduction to get all the image file names with ".jpg" as the suffix in the image folder;
[0360] 4) Get the size of the first image:
[0361] (os.path.join(image_folder,images[0])):Use OpenCV’s imread function;
[0362] 5) Read the first image:
[0363] height,width,layers=frame.shape: Get the height, width and number of channels of the image;
[0364] 6) Create a video encoder:
[0365] fourcc = cv2.VideoWriter_fourcc(*'mp4v'): Use the VideoWriter_fourcc function to create a video encoder and specify the video encoding format as MP4.
[0366] video = cv2.VideoWriter(video_name,fourcc,30,(width,height)) : Use the VideoWriter function to create a video writer object and specify the output video file name, frame rate, and size.
[0367] 7) Write the image to the video frame by frame:
[0368] Use a for loop to traverse the image list images;
[0369] cv2.imread(os.path.join(image_folder,image)): Use OpenCV's imread function to read each image;
[0370] video.write(): Use the write method of the video writing object to write each frame of the image into the video;
[0371] 8) Release the video encoder:
[0372] video.release(): Release the video encoder using the release method of the video writing object.
[0373] Through the above Figure 8 The rendering process of the virtual clothing model shown in the figure allows the computer equipment to fully utilize the rendering capabilities of the rendering tool, improve the offline rendering effect, and display the details and realism of the clothing simulation, bringing a better visual experience to users of the game application and enhancing the artistic value and viewing experience of the clothing simulation animation.
[0374] The method shown in the above embodiment of the present application can be applied to the Ground Truth offline clothing simulation rendering solution based on the rendering tool, which can solve the Ground Truth correction requirements of clothing simulation effects in large-scale 3D games. The rendering tool used in this application can improve the accuracy of Ground Truth correction of offline clothing simulation. Among them, the rendering tool used in this application can have advanced ray tracing and global illumination technology, which can provide high-quality rendering effects, simulate the propagation of light and material reflection in the real world, as well as light and shadow effects and realistic lighting, so that the clothing simulation animation can present delicate textures, realistic lighting and fine shadows, and improve the visual quality and realism of the clothing simulation animation; the above rendering tool also supports global illumination technology, such as global illumination and global reflection, which can better simulate the propagation and reflection of light in the scene, provide more natural and realistic lighting effects, make the rendered clothing simulation animation more realistic and artistic, and enhance the audience's immersion and visual experience; the above solution is customizable and flexible, and can be adjusted and optimized according to user needs to obtain the best rendering effect; the above rendering tool supports hardware acceleration and parallel computing, and utilizes the computing power of multi-core processors to speed up rendering and improve rendering efficiency. This solution can present realistic clothing simulation effects through high-quality rendering, provide higher-quality rendering performance, and better meet the needs of Ground Truth correction.
[0375] For example, users can generate high-quality offline clothing animations using the methods described in the above embodiments of this application. By comparing and analyzing the offline clothing animations with clothing animations simulated in real-time by the game, users can quantitatively evaluate the gap between the real-time physics simulation effect and the ground truth, thereby enabling users to further improve and optimize the real-time physics simulation algorithm. The comparative analysis of the offline clothing animations and clothing animations simulated in real-time by the game can include the following aspects:
[0376] Garment shape comparison: Compare the overall shape and details of virtual garments, including folds, wrinkles, tails, etc. Users can use shape error metrics such as Root Mean Square Error (RMSE) or Structural Similarity Index (SSI) to quantify the difference in shape.
[0377] Garment Particle Position Difference: Compare the positions of garment particles between offline garment animation and real-time garment animation simulated in the game. Users can calculate the Euclidean distance between particles or use surface reconstruction methods to compare the differences in the virtual garment surface.
[0378] Motion Behavior Comparison: Compare the motion behavior of virtual garments in offline garment animations and in-game real-time garment animations, including velocity, acceleration, and rotation. Users can evaluate the difference in motion behavior by calculating the difference in motion vectors or using motion capture data as a reference.
[0379] Collision Effect Comparison: Compares the collision effects between offline garment animation and real-time game simulation, including collision, penetration, and interweaving of virtual garments with other objects. Users can evaluate the difference in collision effects by examining the positional offset of collision points and the realism of collision reactions.
[0380] Energy Loss Comparison: Compare the energy loss of virtual garments in offline garment animations and those simulated in real-time in-game. Users can calculate energy conservation errors or analyze the extent of energy loss by evaluating the difference between the kinetic and potential energies of the virtual garments.
[0381] Stability comparison: Comparing the stability of garment simulations in offline garment animations and real-time in-game garment animations. Users can assess the difference in stability by observing oscillations, jitters, or instabilities in the virtual garments.
[0382] By comparing and analyzing offline clothing animation with real-time game simulation, users can quantitatively assess the gap between real-time physics simulation and Ground Truth. This quantitative analysis can provide a deeper understanding of the strengths and weaknesses of real-time physics simulation algorithms and provide guidance for algorithm improvement and optimization. By continuously improving real-time physics simulation algorithms, we can gradually approach Ground Truth performance, achieving higher-quality, more realistic real-time clothing simulation.
[0383] For example, the solution shown in this application is applied to a realistic virtual game. The virtual clothing worn by the virtual characters in this type of virtual game has the characteristics of multiple layers, large areas of complex robes, multiple folds, multiple embellishments and strong details. Please refer to Figure 9 , which shows a schematic diagram of a physical model provided by an exemplary embodiment of the present application, the physical model has the characteristics of high precision, many layers and complex style. Figure 9 As shown in part (a) of , robe-like clothing includes multiple components such as long sleeves and long skirts, each of which may contain multiple layers; Figure 9 The long sleeves shown on the left side of part (b) are composed of four layers stacked on the right side. Therefore, this type of virtual game has very high requirements for simulation quality and collision response during real-time simulation, so a reference for high-quality simulation effects is needed in the optimization direction. Manual observation has errors and no unified standards, which cannot meet the requirements for better effects. Therefore, through the solution of this application, users can build a Ground Truth offline physical simulation rendering framework based on rendering tools, and obtain more realistic simulation effects by baking clothing simulation animation data offline and then synthesizing animation.
[0384] For another example, in a film and television production scenario, the solution shown in the above embodiment can be used to pre-render an animation of a film and television object offline, and the animation can be used as a video content in the film and television work. Among them, the above virtual fabric model can be a character clothing model of a film and television object wearing a character costume in the film and television work, the above fabric material is the clothing material of the character clothing, and the above fabric mesh file is the clothing mesh file of the character clothing model. Please refer to Figure 10 , which shows a flowchart of a method for rendering character costumes provided by an exemplary embodiment of the present application, such as Figure 10 As shown, the process may include the following steps:
[0385] Step 1010: Obtain rendering attribute information of the character clothing model, where the rendering attribute information includes clothing material. The character clothing model at least includes a model portion corresponding to the fabric, and the clothing material is the material of the model portion corresponding to the fabric.
[0386] Step 1020: Obtain rendering configuration parameters based on the rendering attribute information; the rendering configuration parameters are configuration parameters used when rendering the character clothing model.
[0387] Step 1030: calling a rendering tool to create a character clothing model, and setting rendering configuration parameters in the rendering tool so that the rendering tool renders the character clothing model based on the rendering configuration parameters to obtain at least one frame of rendered image.
[0388] Optionally, the rendering attribute information further includes scene information, which is used to indicate the scene when rendering the character clothing model. The above step 1020 can be implemented as the following steps:
[0389] Step 1020a: Obtain rendering configuration parameters based on clothing material and scene information.
[0390] Optionally, the above step 1020a can be implemented as the following steps: querying the first rendering configuration parameter corresponding to the clothing material, and querying the second rendering configuration parameter corresponding to the scene information, and obtaining the first rendering configuration parameter and the second rendering configuration parameter as the rendering configuration parameter; or, querying the rendering configuration parameter corresponding to the combination of the clothing material and the scene information.
[0391] Optionally, the above step 1010 may be implemented as the following steps: in response to a material setting operation, obtaining the clothing material of the character clothing model.
[0392] Optionally, when the model file of the character clothing model includes description information of clothing materials, the above step 1010 can be implemented as the following steps:
[0393] Step 1010a: Obtain a clothing material that matches the description information of the clothing material from various materials supported by the rendering tool.
[0394] Optionally, the above step 1010a can be implemented as follows: obtaining the name of each material; the material name is the name of the material supported by the rendering tool; obtaining the similarity between each material name and the description information of the clothing material; determining at least two candidate materials from the materials corresponding to each material name in order of similarity from large to small; displaying preview information of at least two candidate materials, the preview information including the preview image and the material name; upon receiving a selection operation on the preview information of the target candidate material, obtaining the target candidate material as the clothing material that matches the description information of the clothing material; the target candidate material is one of the at least two candidate materials.
[0395] Optionally, the “calling a rendering tool to create a character clothing model” in step 1030 may be implemented as the following steps:
[0396] Step 1030a: Obtain a rendering data file; the rendering data file contains at least shape information of the character clothing model and extended information corresponding to the clothing material; the extended information includes one or more of the following: collision body parameters and physical property parameters.
[0397] Step 1030b: Call a rendering tool to generate a character clothing model based on the rendering data file.
[0398] Optionally, the above step 1030a may be implemented as the following steps:
[0399] Step 1030a1: Load the model file of the character costume model; the model file at least contains shape information.
[0400] Step 1030a2: Acquire extended information data, where the extended information data is used to indicate extended information.
[0401] Step 1030a3: Serialize the model file and the extended information data to generate a rendering data file.
[0402] Optionally, the above step 1030a2 may be implemented as the following steps: receiving an extended setting operation, and acquiring extended information data based on the extended setting operation; or querying extended information data corresponding to the material of the clothing.
[0403] Optionally, the shape information includes a clothing mesh file, which is used to indicate the mesh of the character clothing model; in the case where the extended information includes physical attribute parameters, the above step 1030a1 can be implemented as the following steps: loading the clothing mesh file;
[0404] The virtual clothing rendering method further includes: setting a mapping relationship between the mesh of the character clothing model and the physical attribute parameters based on the clothing mesh file; the mapping relationship is used to create a character clothing model with the physical attribute parameters.
[0405] Optionally, before step 1030b, the following steps are further included:
[0406] Step 1022: Select a pre-processing method based on the clothing material; the pre-processing method includes one or more of the following processing methods: data cleaning, denoising, data smoothing, format conversion, level of detail adjustment (LOD) settings, and collision body optimization;
[0407] Step 1024: Process the rendering data file based on the pre-processing method to obtain a pre-processed rendering data file;
[0408] The above step 1030b can be implemented as the following steps:
[0409] Call the rendering tool to generate the character clothing model based on the preprocessed rendering data file.
[0410] Optionally, the virtual clothing rendering method further includes:
[0411] Select post-processing methods based on the clothing material; post-processing includes one or more of the following: color adjustment and visual enhancement;
[0412] Based on the post-processing method, process at least one frame of rendered image.
[0413] For another example, in a fashion design scenario, the scheme shown in the above embodiment can be used to pre-render an offline preview animation of the designed clothing worn on a model; this animation can be used as a preview animation of the model wearing the clothing designed by the fashion designer, so that the fashion designer can preview and evaluate the design effect of the clothing. The above virtual fabric model is the virtual fashion model of the model wearing the clothing in the preview animation, the above fabric material is the fashion material of the clothing, and the above fabric mesh file is the fashion mesh file of the virtual fashion model. Please refer to Figure 11 , which shows a flowchart of a method for rendering virtual fashion provided by an exemplary embodiment of the present application, such as Figure 11 As shown, the process may include the following steps:
[0414] Step 1110: Obtain rendering attribute information of the virtual fashion model, where the rendering attribute information includes fashion material. The virtual fashion model at least includes a model portion corresponding to the fabric, and the fashion material is the material of the model portion corresponding to the fabric.
[0415] Step 1120: Acquire rendering configuration parameters based on the rendering attribute information; the rendering configuration parameters are configuration parameters used when rendering the virtual fashion model.
[0416] Step 1130: calling a rendering tool to create a virtual fashion model, and setting rendering configuration parameters in the rendering tool so that the rendering tool renders the virtual fashion model based on the rendering configuration parameters to obtain at least one frame of rendered image.
[0417] Optionally, the rendering attribute information further includes scene information, which is used to indicate the scene when rendering the virtual fashion model. The above step 1120 can be implemented as the following steps:
[0418] Step 1120a: Obtain rendering configuration parameters based on the fashion material and scene information.
[0419] Optionally, the above step 1120a can be implemented as the following steps: querying the first rendering configuration parameter corresponding to the fashion material, and querying the second rendering configuration parameter corresponding to the scene information, and obtaining the first rendering configuration parameter and the second rendering configuration parameter as the rendering configuration parameter; or, querying the rendering configuration parameter corresponding to the combination of the fashion material and the scene information.
[0420] Optionally, the above step 1110 may be implemented as the following steps: in response to the material setting operation, obtaining the fashion material of the virtual fashion model.
[0421] Optionally, when the model file of the virtual fashion model includes description information of the fashion material, the above step 1110 may be implemented as the following steps:
[0422] Step 1110a: Obtain a fashion material that matches the description information of the fashion material from various materials supported by the rendering tool.
[0423] Optionally, the above step 1110a can be implemented as: obtaining the name of each material; the material name is the name of the material supported by the rendering tool; obtaining the similarity between each material name and the description information of the clothing material; determining at least two candidate materials from the materials corresponding to each material name in order of similarity from large to small; displaying preview information of at least two candidate materials, the preview information including the preview image and the material name; upon receiving a selection operation on the preview information of the target candidate material, obtaining the target candidate material as the clothing material that matches the description information of the clothing material; the target candidate material is one of the at least two candidate materials.
[0424] Optionally, the “calling a rendering tool to create a virtual fashion model” in step 1130 may be implemented as the following steps:
[0425] Step 1130a: Obtain a rendering data file; the rendering data file contains at least shape information of the virtual fashion model and extended information corresponding to the fashion material; the extended information includes one or more of the following: collision body parameters and physical property parameters.
[0426] Step 1130b: Calling a rendering tool to generate a virtual fashion model based on the rendering data file.
[0427] Optionally, the above step 1130a may be implemented as the following steps:
[0428] Step 1130a1: Loading a model file of a virtual fashion model; the model file at least includes shape information.
[0429] Step 1130a2: Acquire extended information data, where the extended information data is used to indicate extended information.
[0430] Step 1130a3: Serialize the model file and the extended information data to generate a rendering data file.
[0431] Optionally, the above step 1130a2 may be implemented as the following steps: receiving an extended setting operation, and acquiring extended information data based on the extended setting operation; or querying extended information data corresponding to the fashion material.
[0432] Optionally, the shape information includes a fashion mesh file, which is used to indicate the mesh of the virtual fashion model. When the extended information includes physical attribute parameters, the above step 1130a1 can be implemented as the following steps: loading the fashion mesh file;
[0433] The virtual clothing rendering method further includes: setting a mapping relationship between the mesh of the virtual fashion model and the physical attribute parameters based on the fashion mesh file; the mapping relationship is used to create a virtual fashion model with the physical attribute parameters.
[0434] Optionally, before step 1130b, the following steps are further included:
[0435] Step 1122: Based on the fashion material, select a pre-processing method; the pre-processing method includes one or more of the following processing methods: data cleaning, denoising, data smoothing, format conversion, level of detail adjustment (LOD) settings, and collision body optimization;
[0436] Step 1124: Process the rendering data file based on the pre-processing method to obtain a pre-processed rendering data file;
[0437] The above step 1130b can be implemented as the following steps:
[0438] The rendering tool is called to generate a virtual fashion model based on the pre-processed rendering data file.
[0439] Optionally, the virtual clothing rendering method further includes:
[0440] Based on the fashion material, select the post-processing method; post-processing includes one or more of the following processing methods: color adjustment and visual effect enhancement;
[0441] Based on the post-processing method, process at least one frame of rendered image.
[0442] In summary, this application has a wide range of application scenarios and commercial value. In the field of gaming, high-quality clothing simulation effects can enhance the visual quality and immersion of the game, bringing a more realistic gaming experience to gamers. In the field of film and television production, realistic clothing simulation effects can enhance the realism of characters and scenes, and improve the viewing and attractiveness of the works. In the field of fashion design, high-quality rendered images can provide fashion designers with realistic fashion design effects. In addition, this application can also be applied to fields such as virtual reality and augmented reality, providing a higher-quality Ground Truth solution for fabric simulation in virtual scenes.
[0443] The technical solutions shown in the above embodiments of the present application can bring the following beneficial effects:
[0444] High-quality rendering: With the help of rendering tools, this solution can achieve high-quality rendering effects. The rendering solution demonstrated in this application can simulate the propagation of light and material reflection in the real world, as well as light and shadow effects and realistic lighting. This enables the rendered images of virtual objects to show delicate fabric textures, realistic lighting, and fine shadows, improving the visual quality and realism of fabric simulation animations.
[0445] Customizability and flexibility: This solution is customizable and flexible, and can be adjusted and optimized according to the needs of users or application scenarios to obtain the best rendering effect. This solution can customize the rendering configuration according to the requirements of specific projects to meet the needs of different scenarios.
[0446] Improving Ground Truth Correction Accuracy: Through the improvements and optimizations of the above technologies, this solution further improves the accuracy of Ground Truth correction for offline fabric simulations, helping to enhance the realism and artistry of fabric simulation animations, enabling them to better meet the needs of practical applications.
[0447] In other words, this solution offers benefits such as high-quality rendering, customizability, and flexibility, further enhancing the quality and application value of offline fabric simulation. This solution will provide a more efficient and accurate solution for fabric production in games, film, and other fields, reducing production costs and improving efficiency. This will help enhance the visual quality and user experience of games, while also possessing a wide range of applications and commercial value.
[0448] Please refer to Figure 12 , which shows a block diagram of a virtual fabric rendering device shown in an exemplary embodiment of the present application, the device can be used to perform the following Figure 2 or Figure 4 In the method shown, all or part of the steps performed by the computer device are as follows Figure 12 As shown, the device includes:
[0449] The information acquisition module 1201 is used to obtain rendering attribute information of a virtual fabric model, where the rendering attribute information includes fabric material; the virtual fabric model at least includes a model portion corresponding to the fabric, and the fabric material is the material of the model portion corresponding to the fabric;
[0450] A parameter acquisition module 1202 is used to acquire rendering configuration parameters based on the rendering attribute information. The rendering configuration parameters are configuration parameters used when rendering the virtual fabric model. There are at least two fabric materials corresponding to different rendering configuration parameters.
[0451] The model rendering module 1203 is configured to call a rendering tool to create the virtual fabric model, and to set the rendering configuration parameters in the rendering tool so that the rendering tool renders the virtual fabric model based on the rendering configuration parameters to obtain at least one frame of rendered image.
[0452] In some embodiments, the rendering attribute information further includes scene information, and the scene information is used to indicate the scene when rendering the virtual fabric model;
[0453] The parameter acquisition module 1202 is used to acquire rendering configuration parameters based on the fabric material and scene information.
[0454] In some embodiments, the parameter acquisition module 1202 is used to query a first rendering configuration parameter corresponding to the fabric material and a second rendering configuration parameter corresponding to the scene information, and acquire the first rendering configuration parameter and the second rendering configuration parameter as rendering configuration parameters;
[0455] Alternatively, the parameter acquisition module 1202 is used to query the rendering configuration parameters corresponding to the combination of fabric material and scene information.
[0456] In some embodiments, the information acquisition module 1201 is configured to acquire the fabric material of the virtual fabric model in response to a material setting operation;
[0457] or,
[0458] When the model file of the virtual fabric model includes description information of the fabric material, the information acquisition module 1201 is used to acquire a fabric material that matches the description information of the fabric material from various materials supported by the rendering tool.
[0459] In some embodiments, the information acquisition module is used to:
[0460] Get the name of each material; the material name is the name of the material supported by the rendering tool;
[0461] Get the similarity between each material name and the description information of the fabric material;
[0462] Determine at least two candidate materials from the materials corresponding to each material name in descending order of similarity;
[0463] Displaying preview information of at least two candidate materials, the preview information including a preview image and a material name;
[0464] When a selection operation on the preview information of the target candidate material is received, the target candidate material is acquired as a fabric material that matches the description information of the fabric material; the target candidate material is one of the at least two candidate materials.
[0465] In some embodiments, the model rendering module is used to obtain a rendering data file; the rendering data file contains at least shape information of the virtual fabric model and extended information corresponding to the fabric material; the extended information includes one or more of the following: collision body parameters and physical property parameters;
[0466] The model rendering module is used to generate a virtual fabric model based on the rendering data file.
[0467] In some embodiments, the model rendering module is used to load a model file of a virtual fabric model; the model file contains at least shape information;
[0468] Acquire extended information data, where the extended information data is used to indicate extended information;
[0469] Serialize the model file and extended information data to generate rendering data files.
[0470] In some embodiments, the model rendering module is configured to receive an extension setting operation and obtain extension information data based on the extension setting operation;
[0471] Alternatively, query the extended information data corresponding to the fabric material.
[0472] In some embodiments, the shape information includes a fabric mesh file, and the fabric mesh file is used to indicate a mesh of the virtual fabric model;
[0473] In the case where the extended information includes physical property parameters, the model rendering module is used to load the fabric mesh file;
[0474] The device also includes: a mapping setting module for setting a mapping relationship between the mesh of the virtual fabric model and the physical property parameters based on the fabric mesh file; the mapping relationship is used to create the virtual fabric model with the physical property parameters.
[0475] In some embodiments, the apparatus further comprises: a pre-processing module for selecting a pre-processing method based on the fabric material; the pre-processing comprises one or more of the following processing methods: data cleaning, denoising, data smoothing, level of detail adjustment (LOD) setting, and collision body optimization;
[0476] A preprocessing module, used for processing the rendering data file based on the preprocessing processing method to obtain the preprocessed rendering data file;
[0477] The model rendering module is used to call the rendering tool to generate a virtual fabric model based on the preprocessed rendering data file.
[0478] In some embodiments, the device further comprises: a post-processing module for selecting a post-processing method based on the fabric material; the post-processing includes one or more of the following processing methods: color adjustment and visual effect enhancement;
[0479] The post-processing module is used to process at least one frame of the rendered image based on a post-processing method.
[0480] It should be noted that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0481] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method; the technical effects achieved by each module performing operations are the same as the technical effects in the embodiment of the method, and will not be elaborated here.
[0482] Please refer to Figure 13 , which shows a structural block diagram of a computer device 1300 shown in an exemplary embodiment of the present application. The computer device can be implemented as the server in the above solution of the present application. Figure 13 As shown, the computer device 1300 includes a central processing unit (CPU) 1301, a system memory 1304 including a random access memory (RAM) 1302 and a read-only memory (ROM) 1303, and a system bus 1305 connecting the system memory 1304 and the CPU 1301. The computer device 1300 also includes a mass storage device 1306 for storing an operating system 1309, application programs 1310, and other program modules 1311.
[0483] The mass storage device 1306 is connected to the central processing unit 1301 via a mass storage controller (not shown) connected to the system bus 1305. The mass storage device 1306 and its associated computer-readable media provide non-volatile storage for the computer device 1300. In other words, the mass storage device 1306 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM drive.
[0484] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, tape cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage medium is not limited to the above-mentioned ones. The above-mentioned system memory 1304 and mass storage device 1306 can be collectively referred to as memory.
[0485] According to various embodiments of the present disclosure, the computer device 1300 may also be connected to a remote computer on a network such as the Internet for operation. That is, the computer device 1300 may be connected to the network 1308 via the network interface unit 1307 connected to the system bus 1305, or the network interface unit 1307 may be used to connect to other types of networks or remote computer systems (not shown).
[0486] The memory further includes at least one computer instruction, which is stored in the memory. The central processing unit 1301 implements all or part of the steps in the methods shown in the above embodiments by executing the at least one computer instruction.
[0487] In an exemplary embodiment, a chip is further provided. The chip includes a programmable logic circuit and / or program instructions. When the chip is run on a computer device, it is used to implement the virtual fabric rendering method in the above aspect.
[0488] In an example embodiment, a computer program product is also provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor reads and executes the computer instructions from the computer readable storage medium to implement the rendering method of the virtual fabric provided by the above-mentioned method embodiments.
[0489] In an example embodiment, a computer readable storage medium is also provided, which stores computer instructions. The computer instructions are loaded and executed by a processor to implement the rendering method of the virtual fabric provided by the above-mentioned method embodiments.
[0490] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0491] Those skilled in the art should realize that, in one or more examples described above, the functions described in the embodiments of the present application can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer readable medium or transmitted as one or more instructions or codes on a computer readable medium. The computer readable medium includes a computer storage medium and a communication medium, wherein the communication medium includes any medium that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0492] The above is only optional embodiments of the present application, and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for rendering virtual fabrics, characterized in that: The method comprises: Obtaining rendering attribute information of a virtual fabric model, wherein the rendering attribute information includes fabric material; the virtual fabric model at least includes a model portion corresponding to the fabric, and the fabric material is the material of the model portion corresponding to the fabric; Acquire rendering configuration parameters based on the rendering attribute information, where the rendering configuration parameters are configuration parameters used when rendering the virtual fabric model; A rendering tool is called to create the virtual fabric model, and the rendering configuration parameters are set in the rendering tool so that the rendering tool renders the virtual fabric model based on the rendering configuration parameters to obtain at least one frame of rendered image.
2. The method according to claim 1, characterized in that The rendering attribute information further includes scene information, and the scene information is used to indicate the scene when rendering the virtual fabric model; The acquiring of rendering configuration parameters based on the rendering attribute information includes: The rendering configuration parameters are obtained based on the fabric material and the scene information.
3. The method according to claim 2, characterized in that The obtaining of the rendering configuration parameters based on the fabric material and the scene information includes: querying a first rendering configuration parameter corresponding to the fabric material, and querying a second rendering configuration parameter corresponding to the scene information, and acquiring the first rendering configuration parameter and the second rendering configuration parameter as the rendering configuration parameters; or, The rendering configuration parameters corresponding to the combination of the fabric material and the scene information are queried.
4. The method according to any one of claims 1 to 3, characterized in that: The step of obtaining rendering attribute information of the virtual fabric model includes: In response to a material setting operation, obtaining the fabric material of the virtual fabric model; or, In a case where the model file of the virtual fabric model includes the description information of the fabric material, a fabric material matching the description information of the fabric material is obtained from various materials supported by a rendering tool.
5. The method according to claim 4, characterized in that The step of obtaining a fabric material that matches the description information of the fabric material from among various materials supported by the rendering tool includes: Obtaining the name of each material, where the material name is the name of the material supported by the rendering tool; Obtaining the similarity between each material name and the description information of the fabric material; Determine at least two candidate materials from the materials corresponding to the respective material names in descending order of the similarities; Displaying preview information of at least two candidate materials, wherein the preview information includes a preview image and the material name; When a selection operation on the preview information of a target candidate material is received, the target candidate material is acquired as a fabric material that matches the description information of the fabric material; the target candidate material is one of at least two candidate materials.
6. The method according to any one of claims 1 to 3, characterized in that: The calling of a rendering tool to create the virtual fabric model includes: Obtaining a rendering data file; the rendering data file at least includes shape information of the virtual fabric model and extended information corresponding to the fabric material; the extended information includes one or more of the following: collision body parameters and physical property parameters; The rendering tool is called to generate the virtual fabric model based on the rendering data file.
7. The method according to claim 6, characterized in that The obtaining of the rendering data file includes: Loading a model file of the virtual fabric model; the model file at least includes the shape information; Acquire extended information data, where the extended information data is used to indicate the extended information; The model file and the extended information data are serialized to generate the rendering data file.
8. The method according to claim 7, characterized in that The obtaining of extended information data includes: receiving an extended setting operation, and acquiring the extended information data based on the extended setting operation; or, The extended information data corresponding to the fabric material is queried.
9. The method according to claim 7, characterized in that The shape information includes a fabric mesh file, and the fabric mesh file is used to indicate the mesh of the virtual fabric model; In a case where the extended information includes the physical property parameters, the step of loading the model file of the virtual fabric model includes: Loading the fabric mesh file; The method further comprises: Based on the fabric mesh file, a mapping relationship between the mesh of the virtual fabric model and the physical property parameters is set; the mapping relationship is used to create the virtual fabric model with the physical property parameters.
10. The method according to claim 6, characterized in that Before calling the rendering tool to generate the virtual fabric model based on the rendering data file, the method further includes: Based on the fabric material, a pre-processing method is selected; the pre-processing includes one or more of the following processing methods: data cleaning, denoising, data smoothing, format conversion, level of detail adjustment LOD setting, and collision body optimization; Processing the rendering data file based on the preprocessing method to obtain the preprocessed rendering data file; The calling of the rendering tool to generate the virtual fabric model based on the rendering data file includes: The rendering tool is called to generate the virtual fabric model based on the pre-processed rendering data file.
11. The method according to claim 1, wherein The method further comprises: Selecting a post-processing method based on the fabric material; the post-processing method includes one or more of the following processing methods: color adjustment and visual effect enhancement; Based on the post-processing method, at least one frame of the rendered image is processed.
12. A virtual fabric rendering device, characterized in that: The device comprises: An information acquisition module is used to acquire rendering attribute information of a virtual fabric model, wherein the rendering attribute information includes fabric material; the virtual fabric model at least includes a model portion corresponding to the fabric, and the fabric material is the material of the model portion corresponding to the fabric; A parameter acquisition module, configured to acquire rendering configuration parameters based on the rendering attribute information, wherein the rendering configuration parameters are configuration parameters used when rendering the virtual fabric model; The model rendering module is used to call a rendering tool to create the virtual fabric model, and to set the rendering configuration parameters in the rendering tool so that the rendering tool renders the virtual fabric model based on the rendering configuration parameters to obtain at least one frame of rendered image.
13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the virtual fabric rendering method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer instruction, and the computer instruction is loaded and executed by a processor to implement the virtual fabric rendering method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the computer instructions are read and executed by a processor of a computer device to implement the method for rendering virtual fabrics according to any one of claims 1 to 11.
Citation Information
Cited By
Dynamic rendering engine and intelligent lighting equipment control method
CN122176127A
