Material effect rendering method and related device
By encapsulating the underlying rendering logic of the UE engine into functional controls, users can render material effects by selecting functional controls, solving the problems of high technical requirements and low efficiency of developers in the existing technology, and achieving rapid rendering and efficient material effects Development.
Patent Information
- Application Number
- CN202310618677.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2024-11-29
AI Technical Summary
In the prior art, developers need to have professional knowledge to select multiple nodes through the UE engine to render material effects, resulting in high technical requirements, high learning costs, high labor costs and low development efficiency.
By encapsulating the underlying rendering logic into functional controls related to appearance, users can select functional controls related to appearance through triggering operations, determine material classes and render, reducing user learning costs and improving development efficiency.
It reduces user learning costs and labor costs, improves development efficiency, and reduces compilation time, and realizes rapid rendering and reuse of material effects.
Smart Images

Figure CN119048656A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a material effect rendering method and related devices. Background Art
[0002] Unreal Engine (UE) can be used to develop virtual production of games and movies, etc. In UE, material refers to a set of attributes used to describe the appearance of an object, which is used to simulate the optical and physical properties of the surface of an object, such as color, texture, reflectivity, transparency, glossiness, etc. Different visual effects can be achieved through different material effects.
[0003] In related technologies, it is generally necessary for artists with professional knowledge to select various parameters through the UE engine based on 2D design drawings, so as to render the corresponding material effects. Taking the material of clothes including dark patterns as an example, artists need to call multiple nodes in the UE engine, namely: Texture Sample node, Normal Map node, Scalar Parameter node, Multiply node, Bump Offset node and Material Output node.
[0004] From the above, we can see that the technical requirements for developers to render different material effects are high and the learning cost is high, which not only leads to high labor costs but also low development efficiency. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a material effect rendering method and related devices, which are used to reduce the technical requirements for developers, reduce learning costs, thereby reducing labor costs and improving development efficiency.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] On the one hand, an embodiment of the present application provides a method for rendering material effects, the method comprising:
[0008] In response to a trigger operation on a model to be rendered, a plurality of function controls corresponding to the model to be rendered are displayed, wherein different function controls are used to describe requirement parameters of the material of the model to be rendered in different aspects of appearance;
[0009] Determining a first requirement parameter for the model to be rendered according to a triggering operation on the functional control;
[0010] Determining a first material type according to the first requirement parameter;
[0011] Rendering is performed according to the first material class to obtain a first material effect for the model to be rendered.
[0012] On the other hand, an embodiment of the present application provides a material effect rendering device, the device comprising: a display unit, a first determination unit, a second determination unit and a rendering unit;
[0013] The display unit is used to display a plurality of function controls corresponding to the model to be rendered in response to a trigger operation on the model to be rendered, wherein different function controls are used to describe the required parameters of the material of the model to be rendered in different aspects of appearance;
[0014] The first determining unit is used to determine a first requirement parameter for the model to be rendered according to a triggering operation on the function control;
[0015] The second determining unit is used to determine a first material type according to the first requirement parameter;
[0016] The rendering unit is used to perform rendering according to the first material class to obtain a first material effect for the model to be rendered.
[0017] On the other hand, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:
[0018] The memory is used to store a computer program and transmit the computer program to the processor;
[0019] The processor is configured to execute the method described in the above aspects according to the instructions in the computer program.
[0020] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above aspects.
[0021] On the other hand, an embodiment of the present application provides a computer program product or a computer program, 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 executes the computer instructions, so that the computer device executes the method described in the above aspects.
[0022] It can be seen from the above technical solution that in response to the trigger operation for the model to be rendered, multiple function controls corresponding to the model to be rendered are displayed, and different function controls are used to describe the requirement parameters of the material of the model to be rendered in different aspects of the appearance, that is, the underlying rendering logic is encapsulated as a function control, so that the functions of the function control are all related to the appearance of the material, so that when the user sees the function control, he will know the effect of the function control on the appearance change, thereby reducing the user's learning cost. According to the trigger operation for the function control, the first requirement parameter for the model to be rendered is determined, and the first material class is determined according to the first requirement parameter, so that rendering is performed according to the first material class to obtain the first material effect for the model to be rendered. Therefore, displaying the function controls related to the appearance to the user can reduce the user's learning cost, thereby reducing the labor cost and improving the development efficiency. Moreover, rendering is performed only based on the first requirement parameter for the model to be rendered, without rendering other irrelevant requirement parameters, which can reduce the compilation time and improve the development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative work.
[0024] Figure 1 A schematic diagram of an application scenario of a method for rendering material effects provided in an embodiment of the present application;
[0025] Figure 2 A schematic diagram of a flow chart of a method for rendering material effects provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of a functional control for clothing provided in an embodiment of the present application;
[0027] Figure 4 A schematic diagram of a material effect provided in an embodiment of the present application;
[0028] Figure 5 A fast multiplexing method provided in the embodiment of the present application Figure 4 Schematic diagram of the selection parameters;
[0029] Figure 6 A fast multiplexing method provided in the embodiment of the present application Figure 5 Schematic diagram of the selection parameters;
[0030] Figure 7 A schematic diagram of the composition of a rendering model provided in an embodiment of the present application;
[0031] Figure 8 A schematic diagram of material mixing provided in an embodiment of the present application;
[0032] Fig. 9A A flow chart for determining quantity provided in an embodiment of the present application;
[0033] Fig. 9B A flow chart for determining quantity provided in an embodiment of the present application;
[0034] Fig.10 A schematic diagram of a material effect rendering system provided in an embodiment of the present application;
[0035] Fig.11 A flowchart of a method for rendering material effects provided in an embodiment of the present application;
[0036] Fig.12 A schematic diagram of the structure of a material effect rendering device provided in an embodiment of the present application;
[0037] Fig.13 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0038] Fig.14 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0040] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] In related technologies, it is generally necessary for an artist with professional knowledge to select various parameters based on a 2D design drawing through the UE engine, so as to render the corresponding material effect. The following is an example of a clothing material including dark patterns:
[0042] (1) Add a Texture Sample node to the material to load the texture map and achieve the texture effect of the material. (2) Add a Normal Map node to load the normal map and connect the normal map to the "Normal" input to simulate the unevenness of the surface. (3) Add a Scalar Parameter node to control the intensity of the dark pattern and connect this node to the "Height" input of the BumpOffset node to achieve the function of dynamically controlling the dark pattern effect. (4) Add a Multiply node to adjust the color and brightness of the texture. (5) Connect the output of the Texture Sample node to the Color input of the Multiply node and the output of the Scalar Parameter node to the Multiplier input of the Multiply node. (6) Add a Bump Offset node to control the height of the normal map. (7) You need to connect the Material Output to the Diffuse input of the Material Output node to complete the creation of the material.
[0043] As can be seen from the above, the above rendering process has high technical requirements for developers. For example, they need to learn the functions of each node, etc. The learning cost is high, which not only leads to high labor costs, but also makes development efficiency low.
[0044] Based on this, the present application provides a material effect rendering method and related device, which encapsulates the underlying rendering logic into a functional control related to the appearance, so that when the user sees the functional control, he will know the effect of the functional control on the appearance, thereby reducing the user's learning cost, thereby reducing labor costs and improving development efficiency.
[0045] The material effect rendering method provided in this application can be applied to computer devices with material effect rendering capabilities, such as terminal devices and servers. Among them, the terminal device can specifically be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an Internet of Things device and a portable wearable device. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart car device, etc. The smart car device can be a car navigation terminal and a car computer, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc., but it is not limited to this; the server can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, and this application does not limit this.
[0046] In order to facilitate understanding of the material effect rendering method provided in the embodiment of the present application, the application scenario of the material effect rendering method is exemplarily introduced below by taking the execution subject of the material effect rendering method as a terminal as an example.
[0047] See also Figure 1 , which is a schematic diagram of an application scenario of the material effect rendering method provided in an embodiment of the present application. The material effect rendering method provided in an embodiment of the present application is installed in the UE engine in the form of a plug-in, in which the underlying rendering logic included in the UE engine is encapsulated as a functional control related to the appearance, and each functional control can describe the required parameters of the model's material in terms of appearance.
[0048] If the user performs a trigger operation on the model to be rendered, multiple function controls corresponding to the model to be rendered will be displayed in the display interface 111 of the terminal device 110, and the user can select the desired function control from the multiple function controls to achieve the desired effect. Figure 1 In the example, if the user wants to render a red dress with dark patterns, the user will select a dress model from multiple models, and the function controls related to the dress model will be displayed. The user can select red from the color function control and dark patterns from the texture function control. Figure 1 Only the color selection is shown, not the texture selection).
[0049] Since each currently displayed function control is used to describe the required parameters of the material appearance of the model to be rendered in different aspects, the terminal device 110 can determine the first required parameter for the model to be rendered according to the function control selected by the user. The first required parameter describes the function control selected by the user from a parameter perspective. Figure 1 In, the first requirement parameter may be “color: red; texture: dark pattern”.
[0050] In order to achieve rendering based on the UE engine, the first requirement parameter can be translated into a material class that the UE engine can understand, that is, the first material class is determined according to the first requirement parameter. The first material class belongs to the material class of the UE engine, and the material class is used to control the appearance and texture of the model to be rendered in the scene, such as metal, glass, wood, leather, cloth, etc. Therefore, rendering is performed according to the first material class to obtain the first material effect for the model to be rendered. For example, in Figure 1 In the example, the first required parameter is converted into a first material class, and the first material class is used to call a texture sampling node, a normal map node, a scalar parameter node, a multiplication node, a convex-concave offset node, and a material output node, etc. Thus, after calling the above nodes, a red dress with dark patterns is obtained.
[0051] Therefore, displaying functional controls related to appearance to users can reduce the user's learning cost, thereby reducing labor costs and improving development efficiency. Moreover, rendering is performed based only on the first requirement parameter for the model to be rendered, without rendering other irrelevant requirement parameters, which can reduce compilation time and improve development efficiency.
[0052] The material effect rendering method provided in the embodiment of the present application can be executed by the terminal device. However, in other embodiments of the present application, the server can also have similar functions as the server, so as to execute the material effect rendering method provided in the embodiment of the present application, or the material effect rendering method provided in the embodiment of the present application can be jointly executed by the terminal device and the server, and this embodiment does not limit this.
[0053] The material effect rendering method provided by the present application is described in detail below through a method embodiment.
[0054] See also Figure 2 , which is a flow chart of a material effect rendering method provided in an embodiment of the present application. For ease of description, the following embodiment is introduced by taking the execution subject of the material effect rendering method as a server as an example. Figure 2 As shown, the rendering method of the material effect includes the following steps:
[0055] S201: In response to a triggering operation on a model to be rendered, display a plurality of function controls corresponding to the model to be rendered.
[0056] In the related art, developers need to learn each material node, etc., which has high technical requirements for developers and high learning costs, which not only leads to high labor costs, but also makes development efficiency low. Based on this, the embodiment of the present application repackages the underlying rendering logic of the UE engine to obtain multiple functional controls. Each functional control can describe the required parameters of the model's material in terms of appearance, that is, the encapsulated functional control is related to the appearance of the material, so that when the user sees the functional control, he will know the effect of the functional control on the appearance change, rather than the normal map node and other controls that he does not know how to use without learning. Among them, the material is a component system in the UE engine, which mainly describes the process of interaction between the scene and the lighting. It determines the surface appearance of the model and the effect after lighting. For example, the cloth material is used to express the appearance, pattern, color, and texture of different cloths.
[0057] See also Figure 3 , which is a schematic diagram of a functional control for clothing provided by an embodiment of the present application. Figure 3 In the figure, the model to be rendered is clothing. The components of clothing may include collars, sleeves, clothing prints, etc. Different components can use different material effects to simulate different clothing materials. Each component can also choose transparent or opaque effects based on the translucent model function control. Determine how many effects the clothing fabric has based on the add layer function control and the delete layer function control. For layer 0_0. Select silk material based on the material type function control. Select several sets of coordinates to use based on the UV channel. Select the color, texture and other effects of the fabric based on the basic color function control. Select the gloss effect of the fabric based on the glossiness function control. Implement shadow-related effects based on the dark shadow function control, etc. Therefore, based on the following examples, Figure 3 The visual interface shown includes multiple functional controls, and parameters such as whether the fabric is transparent or opaque, whether to mix materials, which UV coordinate system to choose, the basic background color of the fabric, fabric details, fabric texture details, fabric repetition, etc. can be selected based on the functional controls, which is convenient and quick.
[0058] It should be noted that the embodiments of the present application do not specifically limit the encapsulation method, and two methods are taken as examples. Method 1: Based on the impact of the function of the material node on the appearance of the model, one or more material nodes are encapsulated to obtain a functional control. For example, the user can actually understand that the function of the material node used to describe the color is to change the color of the model, so the material node can be directly encapsulated as a color functional control. Method 2: Decouple the material node of the UE engine, and then re-encapsulate it based on the description of the model's appearance. For example, the material node called for generating dark patterns is decoupled, and then based on the principle of generating dark patterns, multiple decoupled material nodes are re-encapsulated to obtain a functional control for generating dark patterns.
[0059] Models to be rendered refer to models waiting to be rendered. In a scene, there are multiple models. After rendering starts, multiple models can be used as models to be rendered in turn to obtain the required scene. Among them, scene refers to the virtual environment that contains all models and other elements such as game objects. The scene can include terrain, buildings, characters, props, lighting, sound effects, etc.
[0060] In actual applications, the user can trigger operations on the model to be rendered, such as clicking on the model to be rendered in the scene, and the terminal device responds to the trigger operation on the model to be rendered and displays multiple function controls corresponding to the model to be rendered.
[0061] The response is used to indicate the conditions or states on which the executed operations depend. When the conditions or states on which the operations depend are met, the executed one or more operations may be executed in real time or with a set delay. Unless otherwise specified, the executed multiple operations are not restricted in the order of execution.
[0062] It should be noted that the rendering logic required for rendering different models may be different, so the functional controls required for different models are inconsistent. Therefore, after clarifying the model to be rendered, only the functional controls corresponding to the model to be rendered are displayed, rather than all functional controls. This not only allows the functional controls required for rendering to be displayed more in limited display controls, but also reduces the probability of users making wrong choices and improves the user experience.
[0063] As a possible implementation, at least one of the multiple function controls displayed can be set as a material blueprint node. In the UE engine, Material Blueprint Node is a tool for creating custom material effects. They are graphical editors composed of node networks that can control the color, texture, reflection, transparency and other properties of the object surface. Material blueprint nodes allow developers to create more advanced and complex material effects, such as dynamic textures, deformation effects, particle effects, etc. By using material blueprint nodes, developers can create custom material effects to meet specific needs.
[0064] Therefore, by setting the functional control as a material blueprint node, it can be directly obtained in the material blueprint, allowing artists and other developers to perform secondary development, shortening the time of material development and enhancing its reusability. The entire solution is plug-in-based, and its portability is greatly increased.
[0065] S202: Determine a first requirement parameter for a model to be rendered according to a triggering operation on a functional control.
[0066] After encapsulating the underlying rendering logic as a functional control, the user can know the effect of the functional control on the appearance of the model after seeing it, so that the user can choose to trigger the functional control based on the rendering effect of his own needs. Therefore, the user can make a choice based on the rendering effect of his own needs, that is, to perform a trigger operation based on his own rendering purpose (or demand information), rather than based on the materials (or composition information) required to generate the material effect (i.e. material ball) of the model to be rendered. The material ball includes many rendering effects, and the rendering effects need to be split and combined to avoid conflicts, etc. Therefore, this case can reduce the design difficulty, thereby reducing the user's learning cost.
[0067] Each function control is used to describe the required parameters of the material appearance of the model to be rendered, or in other words, the function control is the external manifestation of the required parameters, and the required parameters are the internal manifestation of the function control. After the user selects the function control, the required parameters corresponding to the function control selected by the user can be obtained, that is, the first required parameters for the model to be rendered.
[0068] S203: Determine a first material type according to the first requirement parameter.
[0069] The first material class is the material class corresponding to the first requirement parameter. The Material class is a very important class in the UE engine, a resource type used to define the appearance and texture of the model. The material contains multiple texture layers, each of which can use different textures and shaders. The material class controls the appearance and texture of objects in the scene. Using the material class, you can create a variety of appearances, including metal, glass, wood, leather, cloth, etc.
[0070] In the related technology, although other plug-ins can also provide cloth simulation functions, they have their own logic and may be incompatible with the native system of the UE engine. Take the UDraper plug-in as an example. The UDraper plug-in uses its own physics engine to simulate cloth effects, while the native system of the UE engine may use a different physics engine; the UDraper plug-in may use its own material system to achieve cloth effects, while the native system of the UE engine may use a different material system; the UDraper plug-in may use its own rendering pipeline to achieve cloth effects, while the native system of the UE engine may use a different rendering pipeline, etc., which leads to incompatibility between the UDraper plug-in and the native system of the UE engine.
[0071] Based on this, the material effect rendering method provided in the embodiment of the present application converts the requirement parameters corresponding to the function control into the material class used by the UE engine, that is, determines the first material class according to the first requirement parameter. Thus, the requirement parameters corresponding to the function control are converted into a language that the UE engine can understand, that is, the material class in the UE engine. Thus, the material effect rendering method provided in the embodiment of the present application converts the encapsulated function control into a language that the UE engine can understand, so as to subsequently call the UE engine to implement the rendering function, avoiding the problem of incompatibility with the native system of the UE engine.
[0072] The embodiment of the present application does not specifically limit the specific implementation method of determining the first material type according to the first requirement parameter. Two methods will be used as examples to illustrate in the following, and will not be repeated here.
[0073] S204: Rendering is performed according to the first material type to obtain a first material effect for the model to be rendered.
[0074] The first material class is obtained based on the first requirement parameter, and the first requirement parameter is based on the user's requirement parameter for the rendering model. Therefore, rendering is only performed based on the first requirement parameter for the model to be rendered, and there is no need to render other irrelevant requirement parameters (for example, it is not compiled based on a material ball including many irrelevant effects, which will be explained in detail later). This can reduce compilation time and improve development efficiency.
[0075] Therefore, rendering is performed based on the first material class that can be understood by the UE engine, and the UE engine can be reused during the rendering process, which improves the utilization efficiency of the UE engine and reduces the development difficulty and content of the plug-in corresponding to the rendering method of the material effect provided in the embodiment of the present application, thereby reducing user costs and improving development efficiency.
[0076] Based on the material effect rendering method provided in the embodiment of the present application, the cloth effects of the clothing of virtual people, digital people, etc. can be quickly produced, which helps virtual people, digital people, etc. to go online quickly and reduces the time consumption in the customization of cloth effects. It can also be applied to the clothing fabrics of personal computers (PCs) or mobile game characters, and quickly produce the clothing fabrics of game characters, such as the clothing fabrics of multiple non-player characters (NPCs), and batch binding and random generation can be performed on the code side, reducing the time spent on adjusting the clothing fabrics of game characters.
[0077] It can be seen from the above technical solution that in response to the trigger operation for the model to be rendered, multiple function controls corresponding to the model to be rendered are displayed, and different function controls are used to describe the requirement parameters of the material of the model to be rendered in different aspects of the appearance, that is, the underlying rendering logic is encapsulated as a function control, so that the functions of the function control are all related to the appearance of the material, so that when the user sees the function control, he will know the effect of the function control on the appearance change, thereby reducing the user's learning cost. According to the trigger operation for the function control, the first requirement parameter for the model to be rendered is determined, and the first material class is determined according to the first requirement parameter, so that rendering is performed according to the first material class to obtain the first material effect for the model to be rendered. Therefore, displaying the function controls related to the appearance to the user can reduce the user's learning cost, thereby reducing the labor cost and improving the development efficiency. Moreover, rendering is performed only based on the first requirement parameter for the model to be rendered, without rendering other irrelevant requirement parameters, which can reduce the compilation time and improve the development efficiency.
[0078] In related technologies, in order to reuse the same rendering logic, artists with professional knowledge are generally required to integrate the materials required for models with repeated logic based on 2D design drawings, select various parameters through the UE engine, and generate a material ball, which can cover most of the effects. For example, a material ball can realize silk material with embroidery effect, silk material without embroidery effect, silk material with printing, and silk material with only solid color. Among them, silk material is effect A, embroidery is effect B, printing is effect C, and solid color is effect D. As a result, artists get a material ball that is flexible in design, can reuse their own logic multiple times, and can adjust multiple effects.
[0079] Material ball is an abstract concept, and a material ball includes multiple material nodes. Material nodes are a tool for creating and editing materials. They are graphical editors composed of node networks that can control the color, texture, reflection, transparency and other properties of the object surface. Material nodes allow developers to create a variety of different material effects, such as metal, wood, glass, water, fire, etc., as well as various special effects, such as glow, distortion, dynamic texture, etc.
[0080] The material of the model determines the specific combination of material nodes. The material node carries the implementation of a specific function. The material node covers the logic of how to translate into the shading language (or the compilation process). Each material node represents a small piece of code in the shader. When a material ball is completed, the entire material ball actually represents a complete shader code. When compiling a material ball, all material nodes will be compiled. Continuing with the above example, if the user only wants to achieve effect A, that is, the user simply needs the effect of silk, then the compilation process will not perform a judgment logic or loop logic because the user has changed the requirements to let the UE engine only translate the material nodes related to effect A into shader code, but compile the entire material ball, resulting in a longer compilation time.
[0081] In other words, in the UE engine, the material nodes will eventually be compiled into different shaders according to different platforms and rendered on the graphics processing unit (GPU). However, due to the architectural design of the UE engine, the material nodes cannot be dynamically compiled, that is, it cannot support loops or judgment logic to dynamically generate corresponding materials. If you need to change the corresponding compilation logic in the UE engine, you need to change the UE engine source code, which will reduce the portability of the material rendering solution.
[0082] After analysis, it is found that compiling based on a material ball including multiple material effects belongs to the situation that there is already a material (referring to the parent class of the material instance), and then the user puts forward his own needs, so it is necessary to compile multiple material effects (even if some material effects are not needed by the user), resulting in a long compilation time. Based on this, the embodiment of the present application is directly compiled based on the needs of the user, that is, the first material class is obtained based on the first demand parameter corresponding to the function control selected by the user, and the first material effect is generated by rendering only based on the first material class. Thus, it can be compiled only based on the needs of the user, without compiling other unnecessary material effects, which reduces the compilation time. However, this method cannot solve the problem of realizing the reuse of the same rendering logic, so the embodiment of the present application will store the first demand parameter and the first material class, and add the corresponding relationship between the first demand parameter and the first material class in the corresponding relationship between the historical demand parameter and the material class. Therefore, after the same demand parameter appears later, the corresponding material class can be directly called based on the corresponding relationship, realizing the rapid reuse of the material class and improving the rendering speed of the model. As a possible implementation method, the first demand parameter, the first material class, and the corresponding relationship between the historical demand parameter and the material class can be saved in the parameter controller.
[0083] It should be noted that in order to make the rendering logic of the material effect plug-in and achieve plug-and-play, in the embodiment of the present application, it is dynamically generated at the application layer. For example, the user generates the flag bits of the corresponding different materials through the function control, and encapsulates the rendering logic layer with the flag as the corresponding first requirement parameter, reads the first requirement parameter in the rendering logic layer, performs the loop or judgment logic according to the first requirement parameter, and dynamically assembles the corresponding logic for the material, and finally generates the material class, and renders the material effect corresponding to the material class. Because the above process does not damage the system architecture of the UE engine, it is designed at the application layer, because it can dynamically adjust which material nodes need to be translated according to the needs of the user, so it is a dynamic compilation of the application layer. Thereby, while the UE engine is not modified, the reuse of the rendering logic is realized, and it is only compiled according to the needs of the user, which reduces the compilation time.
[0084] The embodiments of the present application do not specifically limit the storage method of parameters such as the first demand parameter, the first material class, and the correspondence between the historical demand parameter and the material class. For example, the parameters can be stored in a storage space such as a hard disk to achieve persistent storage of the parameters and prevent parameter loss. Among them, persistence is to save instantaneous data, such as data in the memory that cannot be saved for a long time, as persistent data, such as writing it as data in a certain format or saving it in a database and storing it in the hard disk. For another example, the parameters can also be stored in the cache. After the first preset condition is met (such as before shutdown, storage for a period of time), the parameters corresponding to the demand parameters that meet the second preset condition (such as the material class referenced by the model is greater than the preset number, all stored in the cache) are stored from the cache to the hard disk to prevent parameter loss while reducing the amount of hard disk access.
[0085] The embodiment of the present application does not specifically limit the specific implementation method of determining the first material type according to the first requirement parameter, that is, the specific implementation method of S203, and two methods are used as examples for description below.
[0086] Method 1: If the first demand parameter is consistent with the historical demand parameter, based on the correspondence between the historical demand parameter and the material class, the material class corresponding to the first demand parameter is determined as the first material class.
[0087] The historical demand parameters are demand parameters stored before the first demand parameters are obtained. The correspondence between the historical demand parameters and the material classes includes the demand parameters that the user has used, that is, the correspondence between the historical demand parameters and the material classes corresponding to the historical demand parameters. After the first demand parameter is obtained, the first demand parameter is compared with the historical demand parameters. If the first demand parameter is consistent with one of the historical demand parameters, it means that the user has used the first demand parameter. Based on the correspondence between the historical demand parameters and the material classes, the material class corresponding to the first demand parameter can be quickly determined and used as the first material class.
[0088] Therefore, the demand parameters that the user has used, that is, the historical demand parameters, and the correspondence between the material class corresponding to the historical demand parameters and the historical demand parameters are stored. If the first demand parameter is consistent with the historical demand parameter, it means that the user has used the first demand parameter. The first material class corresponding to the first demand parameter can be quickly determined based on the correspondence, thereby shortening the rendering time and improving the user experience.
[0089] Method 2: If the first demand parameter is inconsistent with the historical demand parameter, the first rendering component corresponding to the first demand parameter is determined according to the correspondence between the demand parameter and the rendering component, the first rendering component is called, and the first material class is generated.
[0090] Among them, the correspondence between the requirement parameters and the rendering components includes the rendering components that should be called to implement each requirement parameter. The rendering component refers to the component determined based on the material node, that is, the function package (component) obtained by encapsulating the functions required for the rendering model in the UE engine, such as the coordinate control component of texture sampling, the mask template control component, the general tool function component, the height map to normal map function component, the normal blending component, the gloss control component, etc. Through the correspondence between the requirement parameters and the rendering components, the requirement parameters corresponding to the encapsulated functional components can be translated into a language that the UE engine can understand, so as to call the UE engine for rendering.
[0091] The historical demand parameters are the demand parameters stored before the first demand parameters are obtained. If the first demand parameters are inconsistent with the historical demand parameters, it means that the first demand parameters are the first demand parameters that appear, and the user has never used them before. It is impossible to quickly determine the first material class based on the correspondence between the historical demand parameters and the material class. The user can only determine the first rendering component corresponding to the first demand parameter based on the correspondence between the demand parameters and the rendering components, call the first rendering component, and generate the first material class.
[0092] From the above, it can be seen that there will not only be incompatibility issues between UDraper plug-ins and the native system of the UE engine, but also because the UDraper plug-in does not use the native system of the UE engine, the generated cloth materials have fewer options, general visual effects, cannot support material mixing, have fewer adjustable parts, and can only be used in combination with the cloth system of the UDraper plug-in and cannot be migrated.
[0093] Based on this, in the embodiment of the present application, after encapsulating the underlying rendering logic of the UE engine as a visible functional component, a corresponding relationship between the demand parameters corresponding to the functional component and the rendering component of the UE engine is also established, so that based on the corresponding relationship, the first demand parameter is translated into a language that the UE engine can understand, that is, a rendering component, and each rendering component corresponds to a rendering logic, and the UE engine is used to generate a first material class based on the rendering logic. Therefore, by calling the UE engine to implement the material class, not only can incompatibility problems be avoided, but also problems such as fewer selectivity of the generated cloth material, general visual effects, inability to support material mixing, fewer adjustable parts, and inability to migrate can be avoided.
[0094] In order to improve the realism of material effects, a model to be rendered can be divided into multiple sections so that different materials can be used for different sections. For example, the body of a vehicle and the tires of the vehicle correspond to different materials. When modeling, the model can be divided into multiple sections based on the materials. Due to different materials, different sections may require different function controls.
[0095] Based on this, the embodiment of the present application provides a specific implementation method of S101, that is, in response to a trigger operation on the model to be rendered, a specific implementation method of displaying multiple function controls corresponding to the model to be rendered. Specifically, the model to be rendered includes at least two parts. For the convenience of explanation, the first part and the second part are used as examples for explanation. If the user performs a trigger operation on the first part, the terminal device displays multiple function controls corresponding to the first part in response to the trigger operation on the first part, and then the user can select the multiple function controls corresponding to the first part until the first material effect for the first part is obtained. If the user performs a trigger operation on the second part, the terminal device displays multiple function controls corresponding to the second part in response to the trigger operation on the second part, and then the user can select the multiple function controls corresponding to the second part until the first material effect for the second part is obtained, thereby obtaining the first material effect for the model to be rendered.
[0096] It should be noted that, it is also possible to first select the multiple functional controls corresponding to the first part and the multiple functional controls corresponding to the second part respectively, and then generate the first requirement parameters for the model to be rendered; determine the first material class according to the first requirement parameters; and render according to the first material class to obtain the first material effect for the model to be rendered.
[0097] See also Figure 4 , which is a schematic diagram of a material effect provided by an embodiment of the present application. Figure 4 In the example, the clothes are divided into two parts: a clothes body 401 and a clothes tail 402. The clothes body 401 is made of a transparent material, and the floor tiles behind the clothes can be seen. The clothes tail 402 is made of an opaque material, and the floor tiles under the clothes cannot be seen. The transparent rendering effect can be selected as a translucent effect.
[0098] Therefore, the model to be rendered is divided into multiple parts based on factors such as material, and corresponding function controls are displayed based on each part. The material effect of each part is selected separately, so that the first material effect of the model to be rendered is more realistic and delicate.
[0099] Since the scene generally includes multiple models, the user may constantly switch models during actual use. For example, after rendering a red car, you also need to render a green car. For another example, after rendering the car and the tree in sequence, you need to re-render the previous car again. In other words, the user may switch to a previously rendered model. In order to achieve rapid reuse, after obtaining the first material effect for the model to be rendered, if the user performs a trigger operation on the model to be rendered again, it means that the user wants to render again based on the previously rendered model. At this time, not only the multiple function controls corresponding to the model to be rendered are displayed, but also the previous user's selection based on multiple function controls, that is, the first selection parameter for the function control.
[0100] Since the rendering effects for a model may be similar, the function controls displayed last time can be displayed together with the first selection parameters corresponding to the last time, so that the user can quickly reuse the last selection, or adjust based on the first selection parameters of the last time to obtain the second selection parameters, thereby determining the second requirement parameters based on the second selection parameters, and determining the second material class based on the second requirement parameters. Finally, rendering is performed based on the second material class to obtain the second material effect for the model to be rendered.
[0101] See also Figure 5 , which is a fast multiplexing method provided by the embodiment of the present application Figure 4 Schematic diagram of the selection parameters. Figure 4 and Figure 5 This is a schematic diagram of different material effects for the same model to be rendered. Figure 5 In the example, the model to be rendered is a clothing model. Figure 4 After the first material effect is shown, if the clothing model is selected again, the function controls displayed last time can be displayed, and the first selection parameters corresponding to the last time can also be displayed, so that the user can quickly adjust to obtain the following Figure 5 The second material effect shown is that both the main body of the clothes and the tail of the clothes are opaque materials, and the materials are smooth, such as reflective strips on the smooth area of the clothes.
[0102] See also Figure 6 , which is a fast multiplexing method provided by the embodiment of the present application Figure 5 Schematic diagram of the selection parameters. Figure 6 In the example, the model to be rendered is a clothing model. Figure 5 After the material effect is shown, if you select the clothing model again, the function controls displayed last time can be displayed, and the corresponding selection parameters of the last time can also be displayed, so that the user can quickly adjust to get the following Figure 6 The material effect shown is that both the main body of the clothes and the tail of the clothes are opaque, and the material is rough. Figure 5 , Figure 6 You can modify the roughness in the selection parameters, or you can modify the opaque rendering parameters such as normal strength, cloth background color, etc., which is convenient and quick.
[0103] Therefore, when the user continuously switches models for rendering, the terminal device will save the selection parameters of the function controls corresponding to each model, such as only saving the selection parameters of the function controls corresponding to the model last time. When the user selects a rendered model again, not only will the function controls corresponding to the model be read and displayed to the user, but the last selection parameters for the function controls will also be displayed to the user so that the user can directly use or adjust them. This not only shortens the user's selection time, but also shortens the rendering time, improving the user experience.
[0104] The material ball mentioned above is an abstract concept. It actually refers to the material class. The material class can include two classes: material and material instance. The material instance inherits from the material, and both can be used to adjust the appearance of a model. The difference between a material and a material instance is that when a variable is defined in a material, taking color as an example, different colors can be changed in the material instance (essentially, the variables defined in the material can be changed). For the UE engine, assigning a material to a model is the process of adjusting the material ball. When a material is used to bind a model to change its appearance, the value of the variable in the material used is actually the default value pre-defined by the material, and the material variable used is the value determined by the material instance itself.
[0105] For materials and material instances, it is a one-to-many relationship, and different material instances may be generated based on the material. For materials and specific models, it is a many-to-many relationship, and different parts of a model may generate material instances from different materials. For material instances and models, it is also a one-to-many relationship, and different parts of a model may have different material instances.
[0106] Based on this, an embodiment of the present application provides a specific implementation method of S203, that is, determining the specific implementation method of the first material class according to the first requirement parameter. Specifically, if the material class includes materials and material instances, the first material class includes target materials and target material instances. The target material is a type of material, which is a material included in the first material class. The target material instance is a type of material instance, which is a material instance included in the first material class.
[0107] After obtaining the first requirement parameters, a target material is generated according to the first requirement parameters, and a target material instance included in the first material class is generated according to the target material and the first requirement parameters, so as to render based on the target material instance and obtain a first material effect for the model to be rendered.
[0108] It can be seen from the above technical solution that after the target material is generated based on part of the parameters in the first requirement parameters, a target material instance is generated based on part of the parameters in the first requirement parameters (generally variables) and the target material, and finally rendering is performed based on the target material instance to obtain the first material effect of the model to be rendered. Therefore, multiple variables can be set in the requirement parameters, and after the material is generated, a material instance is generated based on the variable. After setting the requirement parameters once, multiple material instances can be quickly obtained, which is convenient and fast.
[0109] In order to make the rendered first material effect more realistic, the embodiment of the present application can support material mixing. Taking clothes as an example, the cuffs of the clothes can be made of cotton with lace embroidered on them, that is, two material effects are achieved at the same position. In order to achieve a variety of effects, the embodiment of the present application can support material mixing. In order to deal with material mixing, different layers can be used to achieve different materials, so that the first material effect is more realistic.
[0110] Although the combination of materials will be more flexible as the number of layers increases, the performance will increase and the rendering time will increase during the rendering process, which will reduce the development efficiency. Based on a large number of experiments, the material instance has the best effect when it includes two layers. It not only makes the combination of materials more flexible and the first material effect more realistic, but also ensures the overall performance consumption and development efficiency. In addition, as the number of layers increases, the user's learning cost will continue to increase. Setting the material instance to two layers will not increase the user's learning cost too much.
[0111] Therefore, two materials can be mixed in the same material instance, such as cotton and linen mixed with silk, etc. In the same model, each material will be represented by a layer. Each part of the model includes at most two materials, each material corresponds to a layer, and the two layers of materials are mixed by the material mixing parameters. If no material mixing is performed, it will only be represented as a single material. The following is an example of a material instance including the first layer and the second layer.
[0112] See also Figure 7 , which is a schematic diagram of the composition of a rendering model provided in an embodiment of the present application. A model to be rendered includes multiple parts. Figure 7 In the example, the model to be rendered includes only one part, which corresponds to a material instance, and the material instance includes two layers, a first layer and a second layer.
[0113] Continuing with the first material class as an example, the target materials included in the first material class include a first target material and a second target material, that is, a mixture of two materials. The first layer included in the target material instance corresponds to the first target material, and the second layer included in the target material instance corresponds to the second target material. Obtain the mixing ratio of the first target material and the second target material, as well as the mixing shape of the first target material and the second target material. Generate the target material instance included in the first material class according to the first requirement parameter, the first target material, the second target material, the mixing ratio and the mixing shape.
[0114] The blending ratio refers to the display intensity of each layer after the two layers are mixed together. For example, if the first layer is red with a blending ratio of 80%, and the second layer is white with a blending ratio of 20%, then the color that may be obtained by rendering based on the material instance that includes these two layers is pink. The blending shape refers to the shape of the two layers after they are superimposed together. For example, the first layer is fully covered in red, and the second layer is white, but there is a square hollowed out in the middle. The final rendering results in a cloth with a red square in the middle and white around it.
[0115] As a possible implementation method, the blending ratio and blending shape can be controlled by the mask template control component, and the mask template control component can be used to mix different attributes of a single material output. Continuing with the aforementioned cloth with a red square in the middle and white around it, the part can be fully rendered based on the first layer of red, then the middle square is covered, the part can be fully rendered based on the second layer of white, and then the covered part can be un-covered.
[0116] See also Figure 8 , which is a schematic diagram of a material mixing provided in an embodiment of the present application. Figure 8 In , multiple sets of UV coordinates are supported for rendering, that is, two materials can be rendered in the same position through multiple sets of UV coordinates. Figure 8 In the 801 area, the cloth can be rendered as a transparent material, that is, the inner lining of the clothes is a single material. The cloth in the 802 area is based on the transparent material, with opaque materials and embroidery superimposed, so that an outer garment is worn on the basis of the inner lining.
[0117] As can be seen from the foregoing, the embodiments of the present application can record and store continuously generated parameters, such as the first demand parameter, the first material class, etc., based on a parameter recorder or the like. As the usage time increases, a certain pressure will be placed on the storage space. Based on this, the embodiments of the present application also provide a memory management method, specifically, determining the number of models rendered based on the first material class, that is, determining the number of models rendered based on the first material class among the rendered models. If the number is less than the preset threshold within the preset time, it means that the first material class is used less frequently and the first material class is not used frequently, then the first material class is deleted to release some memory and reduce memory pressure.
[0118] The embodiment of the present application does not specifically limit the size of the preset time and the preset threshold. For example, the preset time may be a cleanup every 24 hours, or the preset time may be before each UE engine shutdown. For another example, the preset threshold may be 1, which means that the first material class that is not used will be cleared.
[0119] The embodiment of the present application does not specifically limit the method for determining the number of models rendered based on the first material class, and is described below using separate counting as an example.
[0120] See also Fig. 9A and Fig. 9B , which is a flow chart of determining quantity provided by an embodiment of the present application. Fig. 9A The a node in Fig. 9B The a node connection in Fig. 9A The b node in Fig. 9B The b-node connection in Fig. 9A The c node in Fig. 9B The c-node connection in .
[0121] S901: Modify the material selection parameters in the visualization interface to obtain second selection parameters.
[0122] The following takes the material selection parameter as the first selection parameter as an example, that is, the first selection parameter is modified to obtain the second selection parameter.
[0123] S902: Determine a second requirement parameter based on the second selection parameter.
[0124] S903: Determine whether the second requirement parameter already has a material, if so, execute S904; if not, execute S913.
[0125] For the convenience of explanation, the material that already has the second requirement parameter is called the old material corresponding to the second requirement parameter.
[0126] S904: Determine whether the old material corresponding to the second requirement parameter already has a material instance, if so, execute S905; if not, execute S907.
[0127] For the convenience of explanation, the material instance that the old material corresponding to the second requirement parameter already has is called the old material instance corresponding to the second requirement parameter.
[0128] S905: Based on the second demand parameter and the old material corresponding to the second demand parameter, modify the parameters of the old material instance corresponding to the second demand parameter to obtain a first modified parameter.
[0129] S906: Based on the first modification parameter, generate a new material instance corresponding to the second requirement parameter.
[0130] S907: The number of references to the old material corresponding to the second requirement parameter is increased by 1, and the number of references to the second selection parameter is increased by 1.
[0131] S908: Check whether the model to be rendered has been bound to other material instances. If so, execute S909; if not, execute S910.
[0132] S909: The number of references to other material instances is reduced by 1, the number of references to the materials corresponding to other material instances is reduced by 1, and the number of references to the selection parameters corresponding to other material instances is reduced by 1.
[0133] S910: Based on the second requirement parameter and the old material corresponding to the second requirement parameter, a new material instance corresponding to the second requirement parameter is generated, and the number of references of the new material instance corresponding to the second requirement parameter is increased by 1.
[0134] S911: Bind the new material instance corresponding to the second requirement parameter to the model to be rendered.
[0135] S912: Added new materials to the visualization interface.
[0136] The selection parameter corresponding to the newly added material is the second selection parameter.
[0137] S913: The reference quantity of the second selection parameter is increased by 1.
[0138] S914: Based on the second requirement parameter, a new material corresponding to the second requirement parameter is generated, and the number of references to the new material corresponding to the second requirement parameter is increased by 1.
[0139] S915: Delete material in the visualization interface.
[0140] The selection parameters corresponding to the deleted material are the old selection parameters, and the requirement parameters corresponding to the old selection parameters are the old requirement parameters.
[0141] S916: The number of references to the old selection parameters is reduced by 1, the number of references to the materials corresponding to the old requirement parameters is reduced by 1, and the number of references to the material instances corresponding to the old requirement parameters is reduced by 1.
[0142] Therefore, (1) when adding a new material through the visual interface, the relevant parameters can be determined and recorded through the parameter recorder, etc., and the reference number of the relevant parameters can be increased by 1 and persisted. (2) When deleting a material through the visual interface, the relevant parameters can be reduced by 1 through the parameter recorder. (3) When modifying the parameters of a material through the visual interface, it will be determined whether the corresponding material already exists. If not, the logic of the newly added material is reused. If so, it is determined whether the corresponding material instance already exists. If so, the parameters of the existing material instance, that is, the old material instance, are modified to obtain a new material instance. If not, the reference number of the relevant parameters is increased by 1, and it is determined whether the model has been bound to other material instances. If not, a new material instance is generated and then bound. If so, the reference number of the currently bound relevant parameters is reduced by 1, and then a new material instance is generated, the new material instance is persisted, and the operation of binding the new material instance is performed.
[0143] As a possible implementation method, if the user does not want to make a selection for the function control, an image including the material effects required for the model to be rendered can be used as an input image, so that the terminal device can generate the first requirement parameters for the model to be rendered based on the input image, or part of the parameters in the first requirement parameters, such as texture parameters.
[0144] Thus, the first requirement parameter can be quickly generated based on the input image, reducing the user's input selection time and improving the user experience.
[0145] In order to facilitate further understanding of the technical solution provided in the embodiment of the present application, the execution subject of the material effect rendering method provided in the embodiment of the present application is taken as the server, and the material effect rendering method is introduced as a whole.
[0146] The following is an explanation of the rendering system for material effects.
[0147] See also Fig.10 , which is a schematic diagram of a material effect rendering system provided in an embodiment of the present application. Fig.10 In the rendering system of the material effect, the rendering system includes an application layer 1010, a rendering material instance 1020, a rendering material 1030, a rendering logic 1040, a rendering component 1050, a storage manager 1060 and a parameter recorder 1070. Each of them will be described below.
[0148] (1) Application layer 1010, which is used to provide users with use. Users can operate based on the visualization interface 1011 included in the application layer 1010. For example, in the visualization interface 1011, multiple function controls are included so that users can select and generate corresponding material effects. In this way, the parameters that need to be adjusted are simplified, and the interface is visually exposed, and material effects such as single-layer material or mixed materials are dynamically generated according to user operations. In addition, users can use the visualization interface to provide images such as texture maps with the desired material effects, and adjust the parameters to adjust the desired material effects.
[0149] (2) Parameter recorder 1070, used to record various parameters, for example, determining the first required parameter for the model to be rendered according to the trigger operation for the function control, etc. Thus, various material instances can be quickly reused to enhance the reusability of the material.
[0150] (3) Storage manager 1060, used to store various parameters, for example, to persist various parameters so that they can be directly called later to reduce compilation time. It is also possible to manage various material classes based on the number of models rendered by various material classes, such as using reference counting to delete unused materials, thereby freeing up memory and reducing storage pressure.
[0151] (4) Rendering logic 1040, which is used to call rendering component 1050 to generate materials according to the required parameters corresponding to the functional components. In the rendering logic layer, it can be divided into transparent control logic 1041 and opaque control logic 1042, and the encapsulated rendering component 1050 is used to assemble the actual rendering logic.
[0152] Among them, in the UE engine, materials are divided into transparent and opaque because transparent materials and opaque materials require different processing methods when rendering. Opaque materials are usually opaque, such as cotton, leather, etc., which do not let light pass through, so conventional rendering techniques such as depth testing and occlusion culling can be used when rendering to improve rendering efficiency. Transparent materials are usually translucent, such as silk, gauze, etc., which let light pass through, so special processing is required when rendering. The rendering of transparent materials needs to consider the refraction and reflection of light, as well as the influence of the background. In order to achieve realistic rendering of transparent materials, technologies such as transparency maps and reflection maps are usually required. The purpose of dividing materials into transparent and opaque is to use different processing methods when rendering and achieve realistic effects.
[0153] (5) Rendering component 1050, used to convert the required parameters corresponding to the functional components into materials according to the instructions of the rendering logic 1040. At the bottom layer, the functions required to implement the rendering material are first encapsulated as rendering components, including the coordinate control component 1051 of the texture sampling, the mask template control component 1052, the general tool function component 1053, the height map to normal map function component 1054, etc. Some components will be used as material blueprint nodes, which can be directly obtained in the material blueprint and provided to technical artists for secondary development.
[0154] (4) Rendering material 1030, including different materials, such as opaque material 1 1031, opaque material 2 1032, transparent material 1 1033, transparent material 2 1034, etc.
[0155] (5) Rendering material instances 1020, including different material instances, such as opaque material instance 1 1021, opaque material instance 2 1022, transparent material instance 1 1023, transparent material instance 2 1024, etc.
[0156] From the above technical solution, it can be seen that a visual interface is expanded in the UE engine editor, and the user calls out when selecting a model in the visual interface. The functional controls corresponding to different materials are exposed in the visual interface. The user selects different functional controls according to needs, changes parameters, and generates different material effects.
[0157] Based on the material effect rendering system provided in the embodiment of the present application, a material effect rendering method can be implemented. Fig.11 Provide explanation.
[0158] See also Fig.11 , which is a flowchart of a material effect rendering method provided in an embodiment of the present application.
[0159] S1101: Start.
[0160] S1102: In response to a triggering operation on the model to be rendered, display a plurality of function controls corresponding to the model to be rendered.
[0161] S1103: Determine a first requirement parameter for the model to be rendered according to a triggering operation on the function control.
[0162] S1104: Determine whether the first demand parameter is consistent with the historical demand parameter, if so, execute S1105; if not, execute S1107.
[0163] S1105: Determine a first rendering component corresponding to the first requirement parameter according to the correspondence between the requirement parameter and the rendering component.
[0164] S1106: Calling a first rendering component to generate a first material class.
[0165] S1107: Based on the correspondence between the historical demand parameters and the material classes, determine the material class corresponding to the first demand parameter as the first material class.
[0166] S1108: Rendering is performed according to the first material class to obtain a first material effect for the model to be rendered.
[0167] S1109: End.
[0168] Therefore, the visualization interface includes multiple functional controls, and the user can select from the multiple functional controls based on the needs. The texture map of the required material or the packaged material can also be used as the input image as needed. The parameter controller generates the first requirement parameter according to the parameters selected by the user and the input image. The first requirement parameter can be identified by the rendering logic, and the first requirement parameter is persisted. The rendering logic reads the basic material type based on the generated first requirement parameter, such as: transparent / opaque, what kind of fabric it is, whether a mask is needed to control the roughness, whether a mask is needed to control the glossiness, etc., and dynamically generates the corresponding material in the editor state (or finds the corresponding material that already exists), and the material will be persisted on the hard disk. After that, the corresponding material instance will be generated according to the material and the first requirement parameter, and the material instance will be bound to the model for recompilation. After recompilation, the UE engine will render the effect of the cloth material in real time.
[0169] Therefore, the material rendering system provided in the embodiment of the present application can at least achieve the following technical effects:
[0170] (1) Lower the threshold for material generation and material effect adjustment in the UE engine (you only need to understand the basic usage of the function controls to adjust the required materials), reduce the participation of technical artists, and reduce labor costs.
[0171] (2) Various parameters are persisted and memory is managed, which not only solves the problem of poor reusability of generated materials and inability to quickly generate material effects to meet business needs, but also accelerates the fabric material generation process. It can also simplify the material development process, speed up the fabric material production time, and improve development efficiency.
[0172] (3) Since the underlying logic is encapsulated, that is, the source code is hidden, users can use it across projects, which not only improves development efficiency but also ensures code security.
[0173] (4) The solution is based on the UE engine, decoupling and encapsulating the material rendering logic, which is compatible with the native material system and can be used in various systems. Different materials are dynamically generated according to different needs in the editor state. Due to the logic encapsulation and plug-in, it can be reused in multiple projects.
[0174] (5) For users who have a basic understanding of the UE engine, they can adjust the material effects based on the simple exposed interfaces. For professional technical artists, they can shorten their workflow or perform secondary development based on the encapsulated interfaces, shortening the time spent on fabric material development and enhancing its reusability and portability.
[0175] (6) It can also support multiple sets of UV, support material mixing and other functions.
[0176] With respect to the material effect rendering method described above, the present application also provides a corresponding material effect rendering device, so that the material effect rendering method described above can be applied and implemented in practice.
[0177] See also Fig.12 , which is a schematic diagram of the structure of a rendering device for material effects provided in an embodiment of the present application. Fig.12 As shown, the material effect rendering device 1200 includes: a display unit 1201, a first determination unit 1202, a second determination unit 1203 and a rendering unit 1204;
[0178] The display unit 1201 is used for displaying a plurality of function controls corresponding to the model to be rendered in response to a trigger operation on the model to be rendered, wherein different function controls are used to describe the required parameters of the material of the model to be rendered in different aspects of appearance;
[0179] The first determining unit 1202 is used to determine a first requirement parameter for the model to be rendered according to a triggering operation on the function control;
[0180] The second determining unit 1203 is used to determine the first material type according to the first requirement parameter;
[0181] The rendering unit 1204 is used to perform rendering according to the first material type to obtain a first material effect for the model to be rendered.
[0182] It can be seen from the above technical solution that in response to the trigger operation for the model to be rendered, multiple function controls corresponding to the model to be rendered are displayed, and different function controls are used to describe the requirement parameters of the material of the model to be rendered in different aspects of the appearance, that is, the underlying rendering logic is encapsulated as a function control, so that the functions of the function control are all related to the appearance of the material, so that when the user sees the function control, he will know the effect of the function control on the appearance change, thereby reducing the user's learning cost. According to the trigger operation for the function control, the first requirement parameter for the model to be rendered is determined, and the first material class is determined according to the first requirement parameter, so that rendering is performed according to the first material class to obtain the first material effect for the model to be rendered. Therefore, displaying the function controls related to the appearance to the user can reduce the user's learning cost, thereby reducing the labor cost and improving the development efficiency. Moreover, rendering is performed only based on the first requirement parameter for the model to be rendered, without rendering other irrelevant requirement parameters, which can reduce the compilation time and improve the development efficiency.
[0183] As a possible implementation manner, the second determining unit 1203 is specifically configured to:
[0184] If the first demand parameter is inconsistent with the historical demand parameter, determining the first rendering component corresponding to the first demand parameter according to the correspondence between the demand parameter and the rendering component, the rendering component is a component determined based on the material node, and the historical demand parameter is a demand parameter stored before obtaining the first demand parameter;
[0185] The first rendering component is called to generate the first material class.
[0186] As a possible implementation manner, the second determining unit 1203 is specifically configured to:
[0187] If the first demand parameter is consistent with the historical demand parameter, the material class corresponding to the first demand parameter is determined as the first material class based on the correspondence between the historical demand parameter and the material class, and the historical demand parameter is the demand parameter stored before the first demand parameter is obtained.
[0188] As a possible implementation, the material effect rendering device 1200 further includes a storage unit, which is used to:
[0189] After determining the first material class, the first demand parameter and the first material class are stored, and the correspondence between the first demand parameter and the first material class is added to the correspondence between historical demand parameters and material classes.
[0190] As a possible implementation, the display unit 1201 is further used for:
[0191] After obtaining the first material effect, in response to a trigger operation on the model to be rendered, displaying a plurality of function controls corresponding to the model to be rendered and first selection parameters corresponding to the function controls;
[0192] The material effect rendering device 1200 further includes an adjustment unit, which is used to:
[0193] Adjusting the first selection parameter to obtain a second selection parameter;
[0194] The first determining unit 1202 is further configured to:
[0195] determining a second requirement parameter based on the second selection parameter;
[0196] The second determining unit 1203 is further configured to:
[0197] Determining a second material type according to the second requirement parameter;
[0198] The rendering unit 1204 is further used for:
[0199] Rendering is performed based on the second material class to obtain a second material effect for the model to be rendered.
[0200] As a possible implementation manner, the material class includes a material and a material instance, and the second determining unit 1203 is specifically configured to:
[0201] Generate target materials included in the first material category according to the first requirement parameter;
[0202] Generate a target material instance included in the first material class according to the target material and the first requirement parameter;
[0203] The rendering unit 1204 is specifically used for:
[0204] Rendering is performed based on the target material instance to obtain a first material effect for the model to be rendered.
[0205] As a possible implementation manner, the material instance includes a first layer and a second layer, the target material includes a first target material and a second target material, the first layer included in the target material instance corresponds to the first target material, the second layer included in the target material instance corresponds to the second target material, and the rendering unit 1204 is specifically used to:
[0206] Acquire a mixing ratio of the first target material and the second target material, and a mixing shape of the first target material and the second target material;
[0207] A target material instance included in the first material class is generated according to the first requirement parameter, the first target material, the second target material, the mixing ratio and the mixing shape.
[0208] As a possible implementation, the model to be rendered includes a first part and a second part, and the display unit 1201 is specifically configured to:
[0209] In response to a trigger operation on the first part, displaying a plurality of function controls corresponding to the first part;
[0210] In response to a trigger operation on the second part, a plurality of function controls corresponding to the second part are displayed.
[0211] As a possible implementation, the material effect rendering device 1200 further includes a third determining unit and a deleting unit;
[0212] The third determining unit is used to:
[0213] Determining the number of models to be rendered based on the first material class;
[0214] The deleting unit is used for:
[0215] If the number is less than a preset threshold within a preset time, the first material class is deleted.
[0216] As a possible implementation, the material effect rendering device 1200 further includes an acquisition unit and a generation unit;
[0217] The acquisition unit is used to:
[0218] Acquire an input image, wherein the input image includes a material effect required by the model to be rendered;
[0219] The generating unit is used for:
[0220] A first requirement parameter for the model to be rendered is generated according to the input image.
[0221] As a possible implementation manner, at least one functional control among the multiple functional controls is a material blueprint node.
[0222] The present application also provides a computer device, which is the computer device described above. The computer device can be a server or a terminal device. The material effect rendering device described above can be built into the server or the terminal device. The computer device provided by the present application will be introduced from the perspective of hardware entity. Fig.13 The following is a schematic diagram of the server structure. Fig.14 Shown is a schematic diagram of the structure of the terminal equipment.
[0223] See also Fig.13 , which is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more processors 1422, such as central processing units (CPU), memory 1432, one or more application programs 1442 or storage media 1430 (such as one or more massive storage devices) for data 1444. Among them, the memory 1432 and the storage medium 1430 may be temporary storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the processor 1422 may be configured to communicate with the storage medium 1430 to execute a series of instruction operations in the storage medium 1430 on the server 1400.
[0224] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server 2003. TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM etc.
[0225] The steps performed by the server in the above embodiment can be based on the Fig.13 The server structure shown.
[0226] The CPU 1422 is used to execute the following steps:
[0227] In response to a trigger operation on a model to be rendered, a plurality of function controls corresponding to the model to be rendered are displayed, wherein different function controls are used to describe requirement parameters of the material of the model to be rendered in different aspects of appearance;
[0228] Determining a first requirement parameter for the model to be rendered according to a triggering operation on the functional control;
[0229] Determining a first material type according to the first requirement parameter;
[0230] Rendering is performed according to the first material class to obtain a first material effect for the model to be rendered.
[0231] Optionally, CPU 1422 may also execute method steps of any specific implementation manner of the method for rendering material effects in the embodiments of the present application.
[0232] See also Fig.14 , which is a structural diagram of a terminal device provided in an embodiment of the present application. Fig.14 The block diagram shows a partial structure of a smart phone related to a terminal device provided in an embodiment of the present application, and the smart phone includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590. Those skilled in the art can understand that Fig.14 The structure of the smartphone shown in the figure does not constitute a limitation of the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0233] Combine the following Fig.14 A detailed introduction to the various components of a smartphone:
[0234] The RF circuit 1510 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 1580 for processing; in addition, the designed uplink data is sent to the base station.
[0235] The memory 1520 may be used to store software programs and modules. The processor 1580 implements various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 1520 .
[0236] The input unit 1530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smartphone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect user touch operations on or near it and drive the corresponding connection device according to a pre-set program. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
[0237] The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 1540 may include a display panel 1541, and the display panel 1541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0238] The smartphone may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. As for other sensors that may be configured in the smartphone, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be described in detail here.
[0239] The audio circuit 1560, the speaker 1561, and the microphone 1562 can provide an audio interface between the user and the smartphone. The audio circuit 1560 can transmit the received audio data to the speaker 1561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560 and converted into audio data, and then the audio data is output to the processor 1580 for processing, and then sent to another smartphone through the RF circuit 1510, or the audio data is output to the memory 1520 for further processing.
[0240] The processor 1580 is the control center of the smartphone, and uses various interfaces and lines to connect various parts of the entire smartphone, and executes various functions of the smartphone and processes data by running or executing software programs and / or modules stored in the memory 1520, and calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.
[0241] The smart phone also includes a power supply 1590 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption management.
[0242] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0243] In the embodiment of the present application, the memory 1520 included in the smart phone can store program codes and transmit the program codes to the processor.
[0244] The processor 1580 included in the smart phone can execute the material effect rendering method provided in the above embodiment according to the instructions in the program code.
[0245] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute the material effect rendering method provided in the above embodiment.
[0246] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the material effect rendering method provided in various optional implementations of the above aspects.
[0247] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (English: Read-Only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0248] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0249] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A rendering method for material effects, It is characterized in that The method comprises: In response to a trigger operation on a model to be rendered, a plurality of function controls corresponding to the model to be rendered are displayed, wherein different function controls are used to describe requirement parameters of the material of the model to be rendered in different aspects of appearance; Determining a first requirement parameter for the model to be rendered according to a triggering operation on the functional control; Determining a first material type according to the first requirement parameter; Rendering is performed according to the first material class to obtain a first material effect for the model to be rendered.
2. The method according to claim 1, It is characterized in that The determining the first material type according to the first requirement parameter includes: If the first demand parameter is inconsistent with the historical demand parameter, determining the first rendering component corresponding to the first demand parameter according to the correspondence between the demand parameter and the rendering component, the rendering component is a component determined based on the material node, and the historical demand parameter is a demand parameter stored before obtaining the first demand parameter; The first rendering component is called to generate the first material class.
3. The method according to claim 1, It is characterized in that The determining the first material type according to the first requirement parameter includes: If the first demand parameter is consistent with the historical demand parameter, the material class corresponding to the first demand parameter is determined as the first material class based on the correspondence between the historical demand parameter and the material class, and the historical demand parameter is the demand parameter stored before the first demand parameter is obtained.
4. The method according to claim 1, It is characterized in that After determining the first material type, the method further includes: The first demand parameter and the first material class are stored, and the correspondence between the first demand parameter and the first material class is added to the correspondence between the historical demand parameters and the material class.
5. The method according to claim 1, It is characterized in that After obtaining the first material effect, the method further includes: In response to a trigger operation on the model to be rendered, displaying a plurality of function controls corresponding to the model to be rendered and first selection parameters corresponding to the function controls; If the first selection parameter is adjusted to obtain a second selection parameter, the method further includes: determining a second requirement parameter based on the second selection parameter; Determining a second material type according to the second requirement parameter; Rendering is performed based on the second material class to obtain a second material effect for the model to be rendered.
6. The method according to claim 1, It is characterized in that The material class includes materials and material instances. The determining the first material class according to the first requirement parameter includes: Generate target materials included in the first material category according to the first requirement parameter; Generate a target material instance included in the first material class according to the target material and the first requirement parameter; The rendering according to the first material class to obtain a first material effect for the model to be rendered includes: Rendering is performed based on the target material instance to obtain a first material effect for the model to be rendered.
7. The method according to claim 6, It is characterized in that The material instance includes a first layer and a second layer, the target material includes a first target material and a second target material, the first layer included in the target material instance corresponds to the first target material, and the second layer included in the target material instance corresponds to the second target material, and generating the target material instance included in the first material class according to the target material and the first requirement parameter includes: Acquire a mixing ratio of the first target material and the second target material, and a mixing shape of the first target material and the second target material; A target material instance included in the first material class is generated according to the first requirement parameter, the first target material, the second target material, the mixing ratio and the mixing shape.
8. The method according to claim 1, It is characterized in that The model to be rendered includes a first part and a second part, and in response to a trigger operation on the model to be rendered, multiple function controls corresponding to the model to be rendered are displayed, including: In response to a trigger operation on the first part, displaying a plurality of function controls corresponding to the first part; In response to a trigger operation on the second part, a plurality of function controls corresponding to the second part are displayed.
9. The method according to claim 1, It is characterized in that The method further comprises: Determining the number of models to be rendered based on the first material class; If the number is less than a preset threshold within a preset time, the first material class is deleted.
10. The method according to claim 1, It is characterized in that The method further comprises: Acquire an input image, wherein the input image includes a material effect required by the model to be rendered; A first requirement parameter for the model to be rendered is generated according to the input image.
11. The method according to any one of claims 1 to 10, It is characterized in that At least one of the multiple function controls is a material blueprint node.
12. A rendering device for material effects, It is characterized in that The device comprises: a display unit, a first determination unit, a second determination unit and a rendering unit; The display unit is used to display a plurality of function controls corresponding to the model to be rendered in response to a trigger operation on the model to be rendered, wherein different function controls are used to describe the required parameters of the material of the model to be rendered in different aspects of appearance; The first determining unit is used to determine a first requirement parameter for the model to be rendered according to a triggering operation on the function control; The second determining unit is used to determine the first material type according to the first requirement parameter; The rendering unit is used to perform rendering according to the first material class to obtain a first material effect for the model to be rendered.
13. A computer device, It is characterized in that The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 11 according to the computer program.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, It is characterized in that When the method is executed on a computer device, the computer device is enabled to execute the method according to any one of claims 1 to 11.
