Material rendering method and device, electronic equipment and storage medium

Through sampling and pre-integration methods, the problem that Matcap technology cannot be dynamically adjusted and combined with PBR is solved, which achieves the flexibility and efficiency of material rendering, and improves the application capabilities in high-quality rendering.

CN119600178APending Publication Date: 2025-03-11HANGZHOU BULLET FINGER UNIVERSE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411548650.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the prior art, Matcap technology cannot dynamically adjust the material and cannot be directly combined with the PBR lighting model, resulting in limited application in high-quality rendering; while Cubemap is difficult to control flexibly under the PBR rendering framework, increasing the consumption of system resources by the rendering process.

Method used

By obtaining the initial material capture map, sampling and pre-integration, the material capture map of different roughness is obtained, and stored to the multi-level aggression texture file to establish a mapping relationship between roughness and level, and realize dynamic adjustment of the material and combination with PBR.

Benefits of technology

The direct combination of Matcap technology and PBR is realized, which improves the flexibility and universality of material rendering, reduces the consumption of system resources by the rendering process, and improves rendering performance and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600178A_ABST
    Figure CN119600178A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a material rendering method and device, electronic equipment and a storage medium, and the method comprises the steps: sampling an initial material capture map; taking the sampled material capture chartlet as a light source, and performing pre-integration on the physical rendering-based materials with different roughness to obtain material capture chartlets corresponding to the physical rendering-based materials with different roughness; storing the material capture chartlets corresponding to the physical rendering-based materials with different roughness in multi-level gradually-distant texture files with different levels, and establishing a mapping relationship between different roughness and different levels to obtain a target material capture chartlet; according to the mapping relation, obtaining a target grade corresponding to the roughness of the target material based on physical rendering; and mapping the normal information of the target material to a two-dimensional texture space to obtain first two-dimensional coordinate information, and sampling the target material capture map. The rendering performance and efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a material rendering method, device, electronic device and storage medium. Background Art

[0002] As the number of mobile game users continues to grow, the requirements for image quality and rendering efficiency in the field of mobile game rendering are also increasing. Among them, Physically Based Rendering (PBR) and Material Capture (Matcap) are two common rendering methods.

[0003] However, the Matcap technology in the related art can only capture and express a single "snapshot" of a specific material and lacks dynamic adjustment capabilities. For current game rendering requirements, there are often requirements for multiple different materials on a model. If each material uses a Matcap map, the consumption of system resources by the rendering process will increase. And Matcap can only express a specific state and lacks dynamic adjustment capabilities. In addition, Matcap technology cannot be directly combined with the PBR lighting model, resulting in limited application in high-quality rendering. PBR technology in the related art usually relies on image-based lighting (IBL) provided by cubemaps to simulate the indirect highlight reflection part. Cubemaps are usually collected through specific photographic equipment or captured in the game engine. The controllability of the rendering process is poor, and Cubemaps will also increase the consumption of system resources by the rendering process. Summary of the invention

[0004] The present disclosure provides a material rendering method, device, electronic device and storage medium to at least solve the following problems in the related art: for Cubemap under the PBR rendering framework, users cannot flexibly and conveniently control Cubemap, resulting in limited user expression ability; for Matcap workflow, it is limited to single material expression and lacks dynamic adjustment capability. Directly expressing multiple materials requires external performance overhead, which increases the consumption of system resources in the rendering process and cannot be combined with the PBR framework.

[0005] The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, a material rendering method is provided, comprising:

[0007] Get the initial material capture map;

[0008] Sampling the initial material capture map to obtain a sampled material capture map;

[0009] Using the sampled material capture map as a light source, pre-integrating physically rendered materials of different roughnesses to obtain material capture maps corresponding to the physically rendered materials of different roughnesses;

[0010] The material capture maps corresponding to physically rendered materials of different roughness are stored in multi-level asymptotic texture files of different levels, and a mapping relationship between different roughness and different levels is established to obtain the target material capture map;

[0011] According to the mapping relationship, a target level corresponding to the roughness of the target material based on physical rendering is obtained; and normal information of the target material based on physical rendering is mapped to a two-dimensional texture space of the target material capture map to obtain first two-dimensional coordinate information;

[0012] The target material capture map is sampled based on the first two-dimensional coordinate information and the target level to obtain a rendering result.

[0013] In an optional embodiment, the sampled material capture map is used as a light source to pre-integrate physically rendered materials of different roughnesses to obtain material capture maps corresponding to physically rendered materials of different roughnesses, including:

[0014] Using the sampled material capture map as a light source input for image-based lighting;

[0015] The light source information of each direction of the light source input of the image-based lighting is traversed, and the physically rendered materials with different roughness are pre-integrated by using Monte Carlo integration and importance sampling to obtain material capture maps corresponding to the physically rendered materials with different roughness.

[0016] In an optional embodiment, storing the material capture maps corresponding to physically rendered materials of different roughnesses in multi-level asymptotic texture files of different levels, and establishing a mapping relationship between different roughnesses and different levels to obtain a target material capture map includes:

[0017] Obtain a multi-level fading texture file corresponding to the initial material capture map;

[0018] The size of the material capture map corresponding to the physically rendered material of different roughness is adjusted, and the material capture map corresponding to the physically rendered material of different roughness is stored in the multi-level asymptotic texture file corresponding to the initial material capture map in order of the adjusted size from large to small, and a mapping relationship between different roughnesses and different levels is established to obtain a target material capture map.

[0019] In an optional embodiment, mapping the normal information of the physically rendered target material to the two-dimensional texture space of the target material capture map to obtain the first two-dimensional coordinate information includes:

[0020] Multiplying the normal information of the target material based on physical rendering by the observation matrix corresponding to the observation space to convert the normal information of the target material based on physical rendering to the observation space to obtain the converted normal information of the target material based on physical rendering;

[0021] The normal information of the converted physically rendered target material is mapped to a range of 0-1 to obtain the first two-dimensional coordinate information.

[0022] In an optional embodiment, sampling the initial material capture map to obtain a sampled material capture map includes:

[0023] Get the world space normal;

[0024] Mapping the world space normal to the two-dimensional texture space of the initial material capture map to obtain second two-dimensional coordinate information;

[0025] The initial material capture map is sampled based on the second two-dimensional coordinate information to obtain a sampled material capture map.

[0026] In an optional embodiment, mapping the world space normal to the two-dimensional texture space of the initial material capture map to obtain the second two-dimensional coordinate information includes:

[0027] Multiplying the world space normal by an observation matrix corresponding to the observation space to convert the world space normal to the observation space to obtain a converted world space normal;

[0028] The converted world space normal is mapped to a range of 0-1 to obtain the second two-dimensional coordinate information.

[0029] In an optional embodiment, after obtaining the rendering result, the method further includes:

[0030] The sampling result is used as the highlight information of the image-based lighting

[0031] According to a second aspect of an embodiment of the present disclosure, a material rendering device is provided, the device comprising:

[0032] An initial material capture map acquisition module is configured to execute acquisition of an initial material capture map;

[0033] A sampling module is configured to perform sampling on the initial material capture map to obtain a sampled material capture map;

[0034] A pre-integration module is configured to perform pre-integration of physically rendered materials of different roughnesses by using the sampled material capture map as a light source to obtain material capture maps corresponding to the physically rendered materials of different roughnesses;

[0035] A target material capture map generation module is configured to store material capture maps corresponding to physically rendered materials of different roughnesses into multi-level asymptotic texture files of different levels, and establish a mapping relationship between different roughnesses and different levels to obtain a target material capture map;

[0036] A mapping module is configured to execute, according to the mapping relationship, obtaining a target level corresponding to the roughness of a target material based on physical rendering; and mapping normal information of the target material based on physical rendering to a two-dimensional texture space of a capture map of the target material to obtain first two-dimensional coordinate information;

[0037] The rendering result generating module is configured to perform sampling of the target material capture map based on the first two-dimensional coordinate information and the target level to obtain a rendering result.

[0038] In an optional embodiment, the pre-integration module includes:

[0039] a light source input determination unit, configured to execute the sampled material capture map as a light source input for image-based lighting;

[0040] The integral sampling unit is configured to execute the light source information of each direction of the light source input of the image-based lighting, and pre-integrate the physically rendered materials with different roughnesses by using Monte Carlo integration and importance sampling to obtain the material capture maps corresponding to the physically rendered materials with different roughnesses.

[0041] In an optional embodiment, the target material capture map generation module includes:

[0042] A multi-level gradually receding texture file acquisition unit is configured to execute acquisition of a multi-level gradually receding texture file corresponding to the initial material capture map;

[0043] The storage establishment unit is configured to adjust the size of the material capture map corresponding to the physically rendered material of different roughnesses, and store the material capture map corresponding to the physically rendered material of different roughnesses in the multi-level asymptotic texture file corresponding to the initial material capture map in order of the adjusted size from large to small, and establish a mapping relationship between different roughnesses and different levels to obtain a target material capture map.

[0044] In an optional embodiment, the mapping module includes:

[0045] A conversion unit is configured to perform multiplication of the normal information of the target material based on physical rendering and the observation matrix corresponding to the observation space to convert the normal information of the target material based on physical rendering to the observation space, thereby obtaining the converted normal information of the target material based on physical rendering;

[0046] The first two-dimensional coordinate information generating unit is configured to map the normal information of the converted physical rendering-based target material into a range of 0-1 to obtain the first two-dimensional coordinate information.

[0047] In an optional embodiment, the sampling module includes:

[0048] A world space normal acquisition unit, configured to perform acquisition of a world space normal;

[0049] A second two-dimensional coordinate information generating unit is configured to map the world space normal to the two-dimensional texture space of the initial material capture map to obtain second two-dimensional coordinate information;

[0050] The sampled material capture map generating unit is configured to perform sampling on the initial material capture map based on the second two-dimensional coordinate information to obtain the sampled material capture map.

[0051] In an optional embodiment, the second two-dimensional coordinate information generating unit includes:

[0052] a converted world space normal generation subunit, configured to perform multiplication of the world space normal with an observation matrix corresponding to an observation space to convert the world space normal to the observation space to obtain a converted world space normal;

[0053] The mapping subunit is configured to map the converted world space normal to a range of 0-1 to obtain the second two-dimensional coordinate information.

[0054] In an optional embodiment, the device further comprises:

[0055] The highlight information determination module is configured to use the sampling result as the highlight information based on the image illumination.

[0056] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device for material rendering, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the material rendering method as described above.

[0057] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the material rendering method as described above.

[0058] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, which includes a computer program, and the computer program is stored in a readable storage medium. At least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the device executes the above-mentioned material rendering method.

[0059] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0060] The present invention obtains an initial material capture map; samples the initial material capture map to obtain a sampled material capture map; uses the sampled material capture map as a light source, pre-integrates physically rendered materials of different roughnesses, and obtains material capture maps corresponding to physically rendered materials of different roughnesses; stores the material capture maps corresponding to physically rendered materials of different roughnesses in multi-level asymptotic texture files of different levels, and establishes a mapping relationship between different roughnesses and different levels to obtain a target material capture map; obtains a target level corresponding to the roughness of a target material based on physical rendering according to the mapping relationship; and The normal information of the material is mapped to the two-dimensional texture space of the target material capture map to obtain the first two-dimensional coordinate information; based on the first two-dimensional coordinate information and the target level, the target material capture map is sampled to obtain a rendering result, so that the Matcap map will have a physically correct association with the roughness in the PBR material, thereby realizing the direct combination of Matcap technology and PBR, improving the flexibility and universality of Matcap, and thus expanding its application in high-quality rendering; in addition, the pre-integration results are stored in multi-level asymptotic texture files of different levels, which is more efficient to use, thereby improving rendering performance and rendering efficiency, and reducing the consumption of system resources by the rendering process.

[0061] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0063] Figure 1 The diagram is a schematic diagram of an application environment of a material rendering method according to an exemplary embodiment.

[0064] Figure 2 A material rendering method according to an exemplary embodiment is shown in FIG. Figure 1 .

[0065] Figure 3 is a schematic diagram of an initial material capture map according to an exemplary embodiment Figure 1 .

[0066] Figure 4 It is a schematic diagram showing a mapping relationship between different roughnesses and different levels according to an exemplary embodiment.

[0067] Figure 5 A material rendering method according to an exemplary embodiment is shown in FIG. Figure 2 .

[0068] Figure 6 A material rendering method according to an exemplary embodiment is shown in FIG. Figure 3

[0069] Figure 7 is a schematic diagram of an initial material capture map according to an exemplary embodiment Figure 2

[0070] Figure 8 is a schematic diagram of a target PBR material with different roughness according to an exemplary embodiment.

[0071] Fig. 9 The figure is a schematic diagram of a rendering result according to an exemplary embodiment.

[0072] Fig.10 The present invention is a block diagram of a material rendering device according to an exemplary embodiment.

[0073] Fig.11 The invention is a block diagram of an electronic device for material rendering according to an exemplary embodiment. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0075] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar first 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 interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0076] First, the technical terms used in the embodiments of the present application are explained:

[0077] Matcap is a method of rendering using pre-rendered images. This technology uses a sphere-like image to represent materials and lighting to simulate material effects at different angles.

[0078] Matcap is a method of representing materials by capturing a single "snapshot" of a material ball. Creators can draw / make a special circular picture (called a Matcap map) to efficiently and flexibly express the specific material effects required by a character or scene without complex lighting calculations. The theme of the Matcap map is a circle, and its top, bottom, left, and right sides represent the rendering performance that the creator wants the model to have on the corresponding model surface or in the direction of the line of sight. In terms of use, you can usually use the Matcap map directly as the final rendering result, or you can use it as intermediate information (such as lighting information) for further processing.

[0079] PBR is a shading method in computer graphics, which aims to simulate the physical behavior of light and its interaction with materials to achieve realistic visual effects.

[0080] IBL is a collection of lighting technologies. Its light source is not a decomposable direct light source, but the surrounding environment is regarded as a large light source.

[0081] Multi-level texture file (mipmap), in order to speed up rendering and reduce image aliasing, the map is processed into a file composed of a series of pre-calculated and optimized pictures. Such a map is called MIP map or mipmap.

[0082] Matcap in related technologies has the following disadvantages:

[0083] Single expression: Existing Matcap technology can only capture and express a single "snapshot" of a specific material. For current game rendering requirements, there are often requirements for multiple different materials on a model. If each material uses a Matcap map, the performance overhead will increase rapidly and lose its high efficiency advantage.

[0084] Inflexible adjustment: Since Matcap can only express specific states, it lacks dynamic adjustment capabilities. When Matcap needs to make subtle adjustments to the material performance, it needs to be re-modified and a new map is produced. Unlike regular material balls, there are many adjustable items that can be adjusted relatively flexibly.

[0085] Unable to be combined with PBR: Matcap technology is a mapping technology based on creators’ creations. There is no way to directly combine it with PBR’s lighting model, which limits its application in high-quality rendering.

[0086] A complete PBR rendering has multiple components, and usually relies on the IBL provided by Cubemap to simulate the indirect highlight reflection. This method captures the ambient lighting information in advance and uses physical algorithms to calculate the interaction between light and materials, mainly providing the highlight reflection results of indirect light.

[0087] The PBR in the related art has the following disadvantages:

[0088] Lack of flexibility: Cubemap is usually in the form of a 3D stereo map, collected by specific photographic equipment or captured within a game engine; it is difficult for creators to draw and adjust manually, and it is difficult to create some stylized effects.

[0089] The performance overhead is higher. Due to the 3D form of the Cubemap texture, its sampling overhead is higher than that of a general 2D texture.

[0090] It can be seen that under the PBR rendering framework, the control ability of Cubemap is limited, and the rendering process consumes a lot of system resources; in the Matcap workflow, the expression of Matcap is limited to a single material, which is not flexible enough and out of touch with PBR, and the rendering process also consumes a lot of system resources.

[0091] Based on this, the present disclosure provides a material rendering method to solve the above-mentioned problems existing in the related art.

[0092] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0093] See also Figure 1 , Figure 1 is a schematic diagram of an application environment of a material rendering method according to an exemplary embodiment. Figure 1 As shown, the application environment may include a terminal 01 and a server 02 .

[0094] The material rendering method of the embodiment of the present application can be executed by the terminal 01, or can be executed by the server 02 and the terminal 01. The material rendering of the embodiment of the present application can also be executed by the client installed on the terminal 01.

[0095] Exemplarily, terminal 01 may include, but is not limited to, electronic devices such as smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices.

[0096] Exemplarily, the server 02 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server 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, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0097] In addition, it should be noted that Figure 1 What is shown is only one application environment of the material rendering method provided by the present disclosure. In other scenarios, there may be other application environments, which are not limited by the present disclosure.

[0098] Figure 2 A material rendering method according to an exemplary embodiment is shown in FIG. Figure 1 ,like Figure 2 As shown, the method comprises at least the following steps:

[0099] In step S11, an initial material capture map is obtained.

[0100] Optionally, step S11 may be understood as a process of making an initial material capture map (initial Matcap map). Figure 3 is a schematic diagram of an initial material capture map according to an exemplary embodiment Figure 1 ,like Figure 3 As shown, the initial material capture map (initial Matcap map) can be manually drawn and adjusted by the user, and supports various stylized effects. The shape of the initial material capture map can be a square with a perfect circle with the largest edge, and the top, bottom, left and right sides of the map represent the desired light source conditions in different directions.

[0101] Optionally, the initial material capture map may also support high dynamic range imaging (HDR), which is a group of technologies used to achieve a larger exposure dynamic range (ie, a larger difference between light and dark) than ordinary digital imaging technologies.

[0102] In step S12, the initial material capture map is sampled to obtain a sampled material capture map.

[0103] In this embodiment, after obtaining the drawn initial material capture map, it can be sampled to resolve the world space sampling to the texture space of the two-dimensional material capture map to obtain the data of the initial material capture map, that is, to obtain the sampled material capture map.

[0104] In step S13, the sampled material capture map is used as a light source, and physically rendered materials of different roughnesses are pre-integrated to obtain material capture maps corresponding to the physically rendered materials of different roughnesses.

[0105] In step S14, the material capture maps corresponding to the physically rendered materials of different roughness are stored in multi-level asymptotic texture files of different levels, and a mapping relationship between different roughness and different levels is established to obtain the target material capture map.

[0106] In this embodiment, the sampling value of the initial material capture map, that is, the sampled material capture map, can be used as the light source input of the IBL to pre-integrate physically rendered materials (PBR materials) of different roughness, obtain material capture maps corresponding to PBR materials of different roughness, and store the material capture maps corresponding to PBR materials of different roughness in multi-level mipmap files (mipmap) of different levels to obtain the target material capture map. The target material capture map can be considered as a brand new special target material capture map. At the same time, a mapping relationship between different roughness and different levels can also be established. It should be noted that the PBR materials of different roughness can be preset PBR materials of various roughnesses, and each PBR material of roughness can obtain a corresponding material capture map after pre-integration.

[0107] Figure 4 is a schematic diagram showing a mapping relationship between different roughnesses and different levels according to an exemplary embodiment. Figure 4 As shown, assuming that the roughness includes roughness 0, roughness 0.2, roughness 0.4, ..., roughness 1.0, the PBR material of roughness 0 is stored in the multi-level asymmetric texture file (mip0) of level 0, the PBR material of roughness 0.2 is stored in the multi-level asymmetric texture file (mip1) of level 1, the PBR material of roughness 0.4 is stored in the multi-level asymmetric texture file (mip2) of level 2, ..., the PBR material of roughness 1.0 is stored in the multi-level asymmetric texture file (mipN) of level N, and the target material capture map is obtained. At the same time, a mapping relationship between roughness 0 and level 0 is established, a mapping relationship between roughness 0.2 and level 1 is established, a mapping relationship between roughness 0.4 and level 2 is established, ..., a mapping relationship between roughness 1.0 and level N is established. As a result, there is a physically correct association between the Matcap map and the roughness in the PBR material.

[0108] In an exemplary embodiment, there is the following relationship between mip levels and different roughnesses:

[0109] mip level = roughness * (1.7 - 0.7 * roughness) * maximum number of mip levels.

[0110] For a mipN texture file of level N, the maximum number of mip levels is N.

[0111] In step S15, according to the mapping relationship, the target level corresponding to the roughness of the target material based on physical rendering is obtained; and the normal information of the target material based on physical rendering is mapped to the two-dimensional texture space of the target material capture map to obtain the first two-dimensional coordinate information.

[0112] In step S16, the target material capture map is sampled based on the first two-dimensional coordinate information and the target level to obtain a rendering result.

[0113] Optionally, when the target material capture map is placed in the game engine for operation, the physically rendered target material (target PBR material) can be obtained, and the roughness of the target PBR material can be determined. Since the above mapping relationship represents the mapping relationship between different roughnesses and different levels, when the above different roughnesses include the roughness of the target PBR material, the target level corresponding to the roughness of the target PBR material can be obtained according to the above mapping relationship. At the same time, the two-dimensional texture space for sampling the target material capture map is calculated according to the normal information of the target PBR material to obtain the first two-dimensional coordinate information.

[0114] It should be noted that the new special target material capture map can be set to trilinear interpolation mode, so as to fuse different mips at a relatively low cost. For example, if the target level is 1.7, the sampling results of the mip1 and mip2 maps can be mixed in proportion. Furthermore, after obtaining the first two-dimensional coordinate information and the target level, the special target material capture map can be sampled through the game engine based on the first two-dimensional coordinate information, the target level, the sampling method, etc. to obtain the rendering result.

[0115] As a result, there can be a physically correct correlation between the Matcap map and the roughness in the PBR material, realizing the direct combination of Matcap technology with PBR, improving the flexibility and universality of Matcap, and thus expanding its application in high-quality rendering; in addition, the results of the pre-integration are stored in multi-level asymptotic texture files of different levels, which is more efficient to use, thereby improving rendering performance and rendering efficiency and reducing the consumption of system resources by the rendering process.

[0116] In an optional embodiment, in the above step S12, sampling the initial material capture map to obtain the sampled material capture map may include:

[0117] In step S121 , the world space normal is obtained.

[0118] In step S122, the world space normal is mapped to the two-dimensional texture space of the initial material capture map to obtain second two-dimensional coordinate information.

[0119] In step S123, the initial material capture map is sampled based on the second two-dimensional coordinate information to obtain a sampled material capture map.

[0120] Optionally, sampling the initial material capture map to obtain the sampled material capture map mainly involves: obtaining the world space normals of the object, which describe the direction of the object surface in three-dimensional space. According to the storage method of the initial material capture map, when sampling the initial material capture map, the world space normals of the object are mapped to the two-dimensional texture space (UV space) of the initial material capture map according to its up, down, left, and right mapping method, and the second two-dimensional coordinate information (UV coordinates) is obtained, and then the UV coordinates are used to sample the material capture map. In this way, each part of the initial material capture map can be rendered in different ways according to the normal direction of the object surface, thereby simulating complex lighting and reflection effects.

[0121] In a specific embodiment, in the above step S122, mapping the world space normal to the two-dimensional texture space of the initial material capture map to obtain the second two-dimensional coordinate information may include:

[0122] The world space normal is converted to the observation space by multiplying the world space normal with the observation matrix corresponding to the observation space to obtain the converted world space normal.

[0123] The converted world space normal is mapped to the range of 0-1 to obtain the second two-dimensional coordinate information.

[0124] In this embodiment, the mapping process may further include two processes: conversion to observation space and mapping to a range of 0-1. The conversion to observation space may refer to: multiplying the normal with the observation matrix to align the reference system of the normal with the camera space, so that the normal remains stationary relative to the viewport.

[0125] Here, mapping to the range of 0-1 may mean that since the range of the normal is [-1, 1], it is necessary to map it to the range of [0, 1] through mathematical transformation so as to be consistent with the texture coordinate system. For example, the normal coordinate may be multiplied by 0.5 and then added with 0.5, so that its center is mapped to (0.5, 0.5) to obtain the second two-dimensional coordinate information.

[0126] Therefore, by converting to the observation space and mapping to the range of [0,1], the normal of the world space can be accurately mapped to the two-dimensional texture space of the initial material capture map, thereby improving the determination accuracy of the sampled material capture map, thereby improving the accuracy of the direct combination of Matcap technology and PBR, effectively improving the flexibility and universality of Matcap, and expanding its application in high-quality rendering.

[0127] Figure 5 A material rendering method according to an exemplary embodiment is shown in FIG. Figure 2 ,like Figure 5As shown, in an optional embodiment, in the above step S13, the above-mentioned material capture map after sampling is used as a light source, and the physically rendered materials with different roughnesses are pre-integrated to obtain the material capture map corresponding to the physically rendered materials with different roughnesses, which may include:

[0128] In step S131, the sampled material capture map is used as a light source input for image-based lighting.

[0129] In step S132, the light source information of each direction of the light source input of the image-based lighting is traversed, and the physically rendered materials with different roughness are pre-integrated using Monte Carlo integration and importance sampling to obtain material capture maps corresponding to the physically rendered materials with different roughness.

[0130] In this embodiment, the sampled value of the Matcap map (i.e., the sampled material capture map) can be used as the light source input of the IBL; Monte Carlo integration and GGX importance sampling are used to traverse the light source information in all directions, and physically based rendering materials (PBR materials) of different roughness are integrated to obtain the material capture maps corresponding to the PBR materials of different roughness. Thus, the association relationship between different roughness and the material capture map obtained by pre-integration is established.

[0131] Among them, Monte Carlo integration is a method of calculating mathematical integrals through random sampling. The basic idea is to select an even set of random numbers, substitute these numbers into the function to be integrated, calculate the sum of the function values, and then divide the sum by the number of samples to get the approximate value of the integral. Specifically, the area and integral function for calculating the integral can be determined, and the physically rendered material of each roughness is sampled to generate sample points, and the function value corresponding to each sample point is calculated. All function values ​​are summed and then divided by the number of sample points to get the approximate value of the integral, that is, the material capture map corresponding to the physically rendered material of each roughness is obtained.

[0132] Exemplarily, the process of sampling each roughness physically rendered material to generate sample points can be implemented by GGX importance sampling. The GGX importance sampling is a technique for generating samples using a non-uniform probability distribution function, and accurately selecting a probability distribution based on information about the function to be integrated, so that the computational variance can be reduced.

[0133] Therefore, by using the sampled material capture map as the light source of image-based lighting for PBR related pre-integration, the material capture map corresponding to the physically rendered material of different roughness is obtained, thereby establishing an association between different roughness and the pre-integrated material capture map, so that there is a physically correct association between the Matcap map and the roughness in the PBR material, thereby realizing the direct combination of Matcap technology and PBR, and improving the flexibility and universality of Matcap.

[0134] In an optional embodiment, in the above step S14, the material capture map corresponding to the physically rendered material of different roughnesses is stored in multi-level asymptotic texture files of different levels, and a mapping relationship between different roughnesses and different levels is established to obtain a target material capture map, including:

[0135] In step S141, a multi-level fading texture file corresponding to the initial material capture map is obtained.

[0136] In step S142, the size of the material capture map corresponding to the physically rendered material of different roughness is adjusted, and the material capture map corresponding to the physically rendered material of different roughness is stored in the multi-level asymptotic texture file corresponding to the initial material capture map in order of the adjusted size from large to small, and a mapping relationship between different roughnesses and different levels is established to obtain the target material capture map.

[0137] Optionally, the initial material capture map corresponds to a multi-level asymptotic texture file, i.e., a multi-level mipmap. The multi-level mipmap is simply a series of texture images, and the subsequent texture image is half of the previous one. Specifically: assuming that the resolution of the initial material capture map is 512x512 pixels (level 1), the second level is 256x256 pixels, the third level is 128x128 pixels, the fourth level is 64x64 pixels, and so on, until the Nth level of pixels is obtained, where N is a positive integer greater than 1. It can be seen that there is a mapping relationship between each level of asymptotic texture files and sizes.

[0138] Since the material capture maps corresponding to PBR materials of different roughness have been pre-integrated through the above steps, the sizes of the material capture maps corresponding to PBR materials of different roughness may be different, and the sizes of the material capture maps corresponding to PBR materials of different roughness can be arranged in order from large to small. At the same time, the texture files of each level can be sorted in order from large to small according to the sizes of the texture images corresponding to the texture files of each level. Then, the material capture maps corresponding to the large-sized PBR materials are stored in the larger mipmap of the corresponding texture image, and the material capture maps corresponding to the small-sized PBR materials are stored in the smaller mipmap of the corresponding texture image to obtain the target material capture map, that is, a new special Matcap map.

[0139] Since PBR materials of different sizes have their own roughness, when storing PBR materials of different sizes in mipmaps of corresponding levels, a mapping relationship between the roughness of PBR materials of different sizes and the corresponding mipmap levels can be established. As a result, there is a physically correct association between the Matcap map and the roughness in the PBR material, thereby realizing the direct combination of Matcap technology and PBR, and improving the flexibility and universality of Matcap; in addition, the results of the pre-integration are stored in multi-level asymptotic texture files of different levels corresponding to the initial material capture map, which is more efficient to use, thereby improving rendering performance and rendering efficiency, and reducing the consumption of system resources by the rendering process.

[0140] It should be noted that the above step S15 can be implemented in a variety of ways, which are not specifically limited. In one embodiment, since the mapping relationship between different roughnesses and different levels has been pre-established, when the target material capture map is placed in the game engine for operation, the roughness corresponding to the target material capture map can be directly found based on the mapping relationship. If the corresponding roughness can be found, the level corresponding to the roughness corresponding to the target material capture map is directly obtained according to the mapping relationship, and the found level is determined as the target level.

[0141] In an optional embodiment, in the above step S15, the normal information of the target material based on physical rendering is mapped to the two-dimensional texture space of the target material capture map to obtain the first two-dimensional coordinate information, including:

[0142] The normal information of the target material based on physical rendering is multiplied by the observation matrix corresponding to the observation space to convert the normal information of the target material based on physical rendering to the observation space to obtain the converted normal information of the target material based on physical rendering. The converted normal information of the target material based on physical rendering is mapped to the range of 0-1 to obtain the first two-dimensional coordinate information.

[0143] In this embodiment, the mapping process of mapping the normal information of the target material based on physical rendering to the two-dimensional texture space of the target material capture map may further include two processes: conversion to the observation space and mapping to the range of 0-1. The conversion to the observation space may refer to: multiplying the normal information of the target material based on physical rendering with the observation matrix corresponding to the observation space so that the reference system of the normal information is aligned with the camera space, so that the normal information remains stationary relative to the viewport.

[0144] Here, mapping to the range of 0-1 may mean that since the range of the normal is [-1, 1], it is necessary to map it to the range of [0, 1] through mathematical transformation so as to be consistent with the texture coordinate system. For example, the normal coordinate may be multiplied by 0.5 and then added with 0.5, so that its center is mapped to (0.5, 0.5) to obtain the first two-dimensional coordinate information.

[0145] Therefore, by converting to the observation space and mapping to the range of [0,1], the normal information of the target material based on physical rendering can be accurately mapped to the two-dimensional texture space of the target material capture map, thereby improving the determination accuracy of the first two-dimensional coordinate information. Since the target material capture map is sampled based on the first two-dimensional coordinate information, the first two-dimensional coordinate information with higher accuracy can effectively improve the rendering accuracy.

[0146] In an optional embodiment, after obtaining the rendering result, the method further includes:

[0147] Use the sampling result as highlight information for image-based lighting.

[0148] In one way, the above sampling results can be used as highlight information based on IBL, so that the Matcap map can participate in the rendering under the PBR framework as a highlight, realizing the direct combination of Matcap technology and PBR, improving the flexibility and universality of Matcap, and thus expanding its application in high-quality rendering.

[0149] In another embodiment, the sampling result may also be main light source information.

[0150] The following is an overall description of the above material rendering method:

[0151] Figure 6A material rendering method according to an exemplary embodiment is shown in FIG. Figure 3 ,like Figure 6 As shown, the material rendering method may include:

[0152] 1. Original Matcap Production

[0153] The initial material capture map (initial Matcap map) can be manually drawn and adjusted by the user, and it supports various stylized effects. The shape of the initial material capture map can be a square, in which there is a perfect circle with the largest edge, and its upper, lower, left and right sides represent the desired light source conditions in different directions. The initial material capture map is more convenient for users, and it can help users draw any stylized lighting. Please refer to the above step S11 for this process, which will not be repeated here.

[0154] 2. Direction Mapping

[0155] The world space sampling is parsed into the texture space of the two-dimensional material capture map to obtain the data of the initial material capture map, that is, the sampled material capture map. Please refer to the above steps S12, S121-S123 for this process, which will not be described in detail.

[0156] 3. Pre-integration

[0157] The sampled material capture map is used as a light source, and physically rendered materials of different roughness are pre-integrated to obtain material capture maps corresponding to physically rendered materials of different roughness; the material capture maps corresponding to physically rendered materials of different roughness are stored in multi-level asymptotic texture files of different levels, and a mapping relationship between different roughness and different levels is established to obtain a target material capture map. Please refer to the above steps S13-S14, S131-S132, S141-S142 for this process, which will not be described in detail.

[0158] 4. Runtime Sampling

[0159] According to the mapping relationship, a target level corresponding to the roughness of the target material based on physical rendering is obtained; and the normal information of the target material based on physical rendering is mapped to the two-dimensional texture space of the target material capture map to obtain the first two-dimensional coordinate information; based on the first two-dimensional coordinate information and the target level, the target material capture map is sampled. Please refer to the above step S16 for this process, which will not be described in detail.

[0160] As an example, the sampled result will be used as highlight information in IBL, as an important contribution to PBR rendering. Of course, in other embodiments, the sampled result can also be main light source information.

[0161] Figure 7is a schematic diagram of an initial material capture map according to an exemplary embodiment Figure 2 , Figure 7 a, b, and c in the above table represent different initial material capture maps. By sampling, direction mapping, and pre-integrating different initial material capture maps, we can obtain Figure 7 The material capture maps corresponding to the PBR materials with different roughness of a, b, and c in Figure 7 The material capture maps corresponding to the PBR materials of different roughness of a, b, and c in the above are stored in multi-level asymptotic texture files of different levels, and the mapping relationship between different roughness and different levels is established to obtain the material capture maps for each level. Figure 7 The target material capture maps of a, b, and c in the image.

[0162] Figure 8 is a schematic diagram of a target PBR material with different roughness according to an exemplary embodiment. Fig. 9 The figure is a schematic diagram of a rendering result according to an exemplary embodiment.

[0163] like Figure 8 a, b, and c in the figure represent the target PBR materials with different roughness during runtime sampling. Figure 8 According to the above mapping relationship, obtain Figure 8 The target level corresponding to the roughness of a in Figure 8 The normal information of a in is mapped to Figure 7 The target material of a in the image captures the two-dimensional texture space of the map to obtain the first two-dimensional coordinate information. Figure 7 The target material capture map of a in is sampled and obtained Fig. 9 The rendering result is shown in a. Figure 8 According to the above mapping relationship, obtain Figure 8 The target level corresponding to the roughness of b in Figure 8 The normal information of b in is mapped to Figure 7 The target material of b in the image captures the two-dimensional texture space of the map to obtain the first two-dimensional coordinate information. Figure 7 The target material capture map of b is sampled and obtained Fig. 9 The rendering result is shown in b. Figure 8 In c, according to the above mapping relationship, obtain Figure 8 The target level corresponding to the roughness of c in Figure 8 The normal information of b in is mapped to Figure 7The target material of c in the image captures the two-dimensional texture space of the map to obtain the first two-dimensional coordinate information. Figure 7 The target material capture map of c in is sampled and obtained Fig. 9 The rendering result is shown in c in FIG. It can be seen that the use of the technical solution disclosed in the present invention can achieve a perfect linkage between the rendering result and the roughness.

[0164] The present disclosure has the following beneficial effects:

[0165] 1) The user's hand-painted Matcap map can be used as a highlight to participate in rendering under the PBR framework.

[0166] 2) The rendering performance is efficient, which is almost the same as Matcap, but because different roughnesses have different expressions, it has an additional dimension of expression compared to Matcap. And the rendering efficiency is more efficient than Cubemap, which is also IBL.

[0167] 3) It can perfectly link with the roughness under the PBR framework, improving the flexibility and universality of Matcap

[0168] The present disclosure also provides a material rendering device. Fig.10 is a block diagram of a material rendering device according to an exemplary embodiment. Fig.10 As shown, the device comprises:

[0169] The initial material capture map acquisition module 21 is configured to execute acquisition of the initial material capture map;

[0170] A sampling module 22 is configured to perform sampling on the initial material capture map to obtain a sampled material capture map;

[0171] The pre-integration module 23 is configured to perform pre-integration on physically rendered materials of different roughnesses by using the sampled material capture map as a light source to obtain material capture maps corresponding to the physically rendered materials of different roughnesses;

[0172] The target material capture map generation module 24 is configured to store the material capture maps corresponding to the physically rendered materials of different roughnesses into multi-level asymptotic texture files of different levels, and establish a mapping relationship between different roughnesses and different levels to obtain the target material capture map;

[0173] The mapping module 25 is configured to execute, according to the mapping relationship, obtaining a target level corresponding to the roughness of the target material based on physical rendering; and mapping the normal information of the target material based on physical rendering to the two-dimensional texture space of the target material capture map to obtain first two-dimensional coordinate information;

[0174] The rendering result generating module 26 is configured to perform sampling of the target material capture map based on the first two-dimensional coordinate information and the target level to obtain a rendering result.

[0175] In an optional embodiment, the pre-integration module includes:

[0176] a light source input determination unit, configured to execute the sampled material capture map as a light source input for image-based lighting;

[0177] The integral sampling unit is configured to execute the light source information of each direction of the light source input of the image-based lighting, and pre-integrate the physically rendered materials with different roughnesses by using Monte Carlo integration and importance sampling to obtain the material capture maps corresponding to the physically rendered materials with different roughnesses.

[0178] In an optional embodiment, the target material capture map generation module includes:

[0179] A multi-level gradually receding texture file acquisition unit is configured to execute acquisition of a multi-level gradually receding texture file corresponding to the initial material capture map;

[0180] The storage establishment unit is configured to adjust the size of the material capture map corresponding to the physically rendered material of different roughnesses, and store the material capture map corresponding to the physically rendered material of different roughnesses in the multi-level asymptotic texture file corresponding to the initial material capture map in order of the adjusted size from large to small, and establish a mapping relationship between different roughnesses and different levels to obtain a target material capture map.

[0181] In an optional embodiment, the mapping module includes:

[0182] A conversion unit is configured to perform multiplication of the normal information of the target material based on physical rendering and the observation matrix corresponding to the observation space to convert the normal information of the target material based on physical rendering to the observation space, thereby obtaining the converted normal information of the target material based on physical rendering;

[0183] The first two-dimensional coordinate information generating unit is configured to map the normal information of the converted physical rendering-based target material into a range of 0-1 to obtain the first two-dimensional coordinate information.

[0184] In an optional embodiment, the sampling module includes:

[0185] A world space normal acquisition unit, configured to perform acquisition of a world space normal;

[0186] A second two-dimensional coordinate information generating unit is configured to map the world space normal to the two-dimensional texture space of the initial material capture map to obtain second two-dimensional coordinate information;

[0187] The sampled material capture map generating unit is configured to perform sampling on the initial material capture map based on the second two-dimensional coordinate information to obtain the sampled material capture map.

[0188] In an optional embodiment, the second two-dimensional coordinate information generating unit includes:

[0189] a converted world space normal generation subunit, configured to perform multiplication of the world space normal with an observation matrix corresponding to an observation space to convert the world space normal to the observation space to obtain a converted world space normal;

[0190] The mapping subunit is configured to map the converted world space normal to a range of 0-1 to obtain the second two-dimensional coordinate information.

[0191] In an optional embodiment, the device further comprises:

[0192] The highlight information determination module is configured to use the sampling result as the highlight information based on the image illumination.

[0193] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0194] In an exemplary embodiment, a material rendering electronic device is also provided, comprising a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the steps of any material rendering method in the above embodiments when executing the instructions stored in the memory. The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a server. Fig.11It is a block diagram of an electronic device for material rendering according to an exemplary embodiment. The electronic device 30 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 31 (the central processing unit 31 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 33 for storing data, and one or more storage media 32 (such as one or more mass storage devices) for storing application programs 323 or data 322. Among them, the memory 33 and the storage medium 32 can be short-term storage or permanent storage. The program stored in the storage medium 32 may include one or more modules, each of which may include a series of instruction operations in the electronic device. Furthermore, the central processing unit 31 can be configured to communicate with the storage medium 32 to execute a series of instruction operations in the storage medium 32 on the electronic device 30. The electronic device 30 may also include one or more power supplies 36, one or more wired or wireless network interfaces 35, one or more input and output interfaces 34, and / or one or more operating systems 321, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0195] The input / output interface 34 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the electronic device 30. In one example, the input / output interface 34 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In an exemplary embodiment, the input / output interface 34 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0196] It can be understood by those skilled in the art that Fig.11 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.11 More or fewer components as shown, or with Fig.11 Different configurations shown.

[0197] In an exemplary embodiment, a computer-readable storage medium is also provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can perform the steps of any material rendering method in the above embodiments.

[0198] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the material rendering method provided in any one of the above embodiments is implemented.

[0199] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present disclosure can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0200] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0201] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A material rendering method, characterized in that: The method comprises: Get the initial material capture map; Sampling the initial material capture map to obtain a sampled material capture map; Using the sampled material capture map as a light source, pre-integrating physically rendered materials of different roughnesses to obtain material capture maps corresponding to the physically rendered materials of different roughnesses; The material capture maps corresponding to physically rendered materials of different roughness are stored in multi-level asymptotic texture files of different levels, and a mapping relationship between different roughness and different levels is established to obtain the target material capture map; According to the mapping relationship, a target level corresponding to the roughness of the target material based on physical rendering is obtained; and normal information of the target material based on physical rendering is mapped to a two-dimensional texture space of the target material capture map to obtain first two-dimensional coordinate information; The target material capture map is sampled based on the first two-dimensional coordinate information and the target level to obtain a rendering result.

2. The material rendering method according to claim 1, characterized in that: The method uses the sampled material capture map as a light source, pre-integrates physically rendered materials of different roughnesses, and obtains material capture maps corresponding to the physically rendered materials of different roughnesses, including: Using the sampled material capture map as a light source input for image-based lighting; The light source information of each direction of the light source input of the image-based lighting is traversed, and the physically rendered materials with different roughness are pre-integrated by using Monte Carlo integration and importance sampling to obtain material capture maps corresponding to the physically rendered materials with different roughness.

3. The material rendering method according to claim 1, characterized in that: The material capture map corresponding to the physically rendered material of different roughnesses is stored in multi-level asymptotic texture files of different levels, and a mapping relationship between different roughnesses and different levels is established to obtain a target material capture map, including: Obtain a multi-level asymptotic texture file corresponding to the initial material capture map; The size of the material capture map corresponding to the physically rendered material of different roughness is adjusted, and the material capture map corresponding to the physically rendered material of different roughness is stored in the multi-level asymptotic texture file corresponding to the initial material capture map in order of the adjusted size from large to small, and a mapping relationship between different roughnesses and different levels is established to obtain a target material capture map.

4. The material rendering method according to claim 1, characterized in that: The step of mapping the normal information of the target material based on physical rendering to the two-dimensional texture space of the target material capture map to obtain first two-dimensional coordinate information includes: Multiplying the normal information of the target material based on physical rendering by an observation matrix corresponding to the observation space to convert the normal information of the target material based on physical rendering to the observation space to obtain converted normal information of the target material based on physical rendering; The normal information of the converted physically rendered target material is mapped to a range of 0-1 to obtain the first two-dimensional coordinate information.

5. The material rendering method according to any one of claims 1 to 4, characterized in that: The step of sampling the initial material capture map to obtain a sampled material capture map includes: Get the world space normal; Mapping the world space normal to the two-dimensional texture space of the initial material capture map to obtain second two-dimensional coordinate information; The initial material capture map is sampled based on the second two-dimensional coordinate information to obtain a sampled material capture map.

6. The material rendering method according to claim 5, characterized in that: Mapping the world space normal to the two-dimensional texture space of the initial material capture map to obtain second two-dimensional coordinate information includes: Multiplying the world space normal by an observation matrix corresponding to the observation space to convert the world space normal to the observation space to obtain a converted world space normal; The converted world space normal is mapped to a range of 0-1 to obtain the second two-dimensional coordinate information.

7. The material rendering method according to any one of claims 1 to 4, characterized in that: After obtaining the rendering result, the method further includes: The sampling result is used as highlight information of the image-based lighting.

8. A material rendering device, characterized in that: The device comprises: An initial material capture map acquisition module is configured to execute acquisition of an initial material capture map; A sampling module is configured to perform sampling on the initial material capture map to obtain a sampled material capture map; A pre-integration module is configured to perform pre-integration of physically rendered materials of different roughnesses by using the sampled material capture map as a light source to obtain material capture maps corresponding to the physically rendered materials of different roughnesses; A target material capture map generation module is configured to store material capture maps corresponding to physically rendered materials of different roughnesses into multi-level asymptotic texture files of different levels, and establish a mapping relationship between different roughnesses and different levels to obtain a target material capture map; A mapping module is configured to execute, according to the mapping relationship, obtaining a target level corresponding to the roughness of a target material based on physical rendering; and mapping normal information of the target material based on physical rendering to a two-dimensional texture space of a capture map of the target material to obtain first two-dimensional coordinate information; The rendering result generating module is configured to perform sampling of the target material capture map based on the first two-dimensional coordinate information and the target level to obtain a rendering result.

9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the material rendering method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the material rendering method according to any one of claims 1 to 7.