Method and apparatus for obtaining object material through specific scene rendering results

Through specific scene rendering and BRDF uniform sampling, the problem of material not being universal in different rendering engines is solved, and the general expression and efficient acquisition of materials are realized, which is suitable for multi-engine multiplexing.

CN114972600BActive Publication Date: 2025-07-25HANGZHOU QUNHE INFORMATION TECHNOLOGIES CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210643001.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-08
Publication Date
2025-07-25
Estimated Expiration
2042-06-08

AI Technical Summary

Technical Problem

The object materials cannot be generalized in different rendering engines, and it is difficult for the existing technology to obtain the BRDF of the material by modifying the engine code, and the existing methods are complex in calculations or lack of material versatility.

Method used

By building a specific scene, using the rendering engine to render a series of pictures, perform uniform sampling of BRDF, converting it to normal space and then storage in the Rusinkiewicz coordinate system, fitting the target shading model.

Benefits of technology

It realizes the general expression of object materials, which is convenient for reuse in other rendering engines, simplifies the material acquisition process, and improves efficiency and versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114972600B_ABST
    Figure CN114972600B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for obtaining an object material through a specific scene rendering result, comprising the following steps: building a scene and performing specific scene settings, wherein the specific scene settings mean that for all pixels obtained by rendering, the incident direction and the outgoing direction of the light source at the shading point corresponding to the pixel traverse the entire normal space hemisphere; inputting the scene and the specific scene settings into a rendering engine, and obtaining a series of pictures through rendering; and obtaining BRDF sampling data of the object material by analyzing the series of pictures and performing uniform sampling of the BRDF. By analyzing a series of pictures obtained by rendering a specific scene by the engine, the method and device can obtain a general expression mode of the object material in the corresponding scene, which is convenient for the reuse of the object material in other rendering engines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of rendering, and particularly relates to a method and device for obtaining object materials through specific scene rendering results. Background Art

[0002] In the development process of computer graphics, researchers have been committed to rendering more realistic images within a limited time. An important part of completing this work is to use a good way to describe the materials of objects, thereby reflecting the interaction between objects and light. As a result, many shading models have been proposed by researchers in computer graphics to seek better rendering effects in certain aspects.

[0003] In actual application scenarios, different rendering engines may select different shading models, and there may also be differences in the implementation of shading models. This brings a problem that the materials described in one engine are often unable to be exported and reused in other engines.

[0004] At the same time, the code of many engines is not open source, so it is also impossible to directly sample the BRDF of the corresponding material by modifying the engine code.

[0005] Patent document CN102819864A discloses a method for reconstructing geometry and surface materials based on a photometric map, including: (1) material segmentation, constructing an initial material weight map, and estimating DiffuseAlbedo. (2) Estimating the surface normal map. (3) Using the Alternating-Constrained-Least-Square method to iteratively solve the normal vector and construct the BRDF material basis. (4) Enhancing the depth field. Based on the normal vector map, the least-squares surface depth information is obtained by solving the Poisson equation. Although this method can recover the process of geometry and material basis from a set of photo sequences with known lighting conditions, the calculation process is too complex, and the obtained BRDF material basis does not have the generality to reconstruct various shading models.

[0006] Patent document CN108985333A discloses a method and system for obtaining materials based on a neural network, using synthetic material data that simulates the acquisition results of an actual camera as training data; then training a neural network according to the synthetic training data; during application, the trained lighting patterns are used to irradiate the target object in sequence to obtain a set of photos, and then the pixels and channels of the photos are traversed in sequence to form a vector and sent into the recovery network to obtain material information. This process can obtain material information from photos, but it is not clear whether it can be exported in a general format and used to construct other shading models. Summary of the Invention

[0007] In view of the above, the object of the present invention is to provide a method and device for obtaining the material of an object through the rendering result of a specific scene, by analyzing a series of pictures obtained by rendering a specific scene by an engine, so as to obtain a general expression of the material of the object in the corresponding scene.

[0008] To achieve the above object of the invention, a method for obtaining the material of an object through the rendering result of a specific scene provided by an embodiment of the present invention includes the following steps:

[0009] Build a scene and perform specific scene settings, where the specific scene settings mean that for all pixels obtained by rendering, the incident direction and the outgoing direction of the light source at the shading point corresponding to the pixel traverse the entire normal space hemisphere;

[0010] Input the scene and the specific scene settings into the rendering engine, and a series of pictures are obtained through rendering;

[0011] By analyzing a series of pictures and performing uniform sampling of BRDF, the BRDF sampling data of the object material is obtained.

[0012] In one embodiment, the built scene includes a sphere located at the origin of the world coordinate system, with a radius of r and pasted with the object material, a perspective camera, and a parallel light source parallel to the yOz plane. All parallel light sources always point to the origin, and the angle between their directions and the z-axis changes from 0° to 180° at a fixed angular interval. Among them, the perspective camera is located at (0, 0, 4r), facing the origin of the world coordinate system, the up vector is (0, 1, 0), and the field of view angle is 45°.

[0013] In one embodiment, the series of pictures obtained through rendering are pictures in EXR format, which is convenient for subsequent sampling.

[0014] In one embodiment, analyzing a series of pictures and performing uniform sampling of BRDF includes:

[0015] Traverse each pixel of each picture, and screen the pixels with colors for BRDF sampling; for the incident direction of BRDF, the incident directions of all pixel points in the same picture are the same, that is, the direction of the parallel light source; for the outgoing direction of BRDF, each pixel point in the same picture is different, but the pixel points at the same position on different pictures are the same. Based on this, perform a light projection similar to ray tracing, and use the projection direction from the perspective camera to the center of the corresponding pixel on the virtual screen as the outgoing direction. Among them, the incident direction and the outgoing direction of each pixel point constitute the BRDF sampling data.

[0016] In one embodiment, the BRDF sampling data obtained by uniform sampling is converted from world space to normal space.

[0017] In one embodiment, when the scene is a unit sphere with a radius of 1, converting the BRDF sampling data obtained by uniform sampling from world space to normal space includes: converting the incident direction and the outgoing direction in world space to the incident direction and the outgoing direction in normal space according to the normal of the sphere surface corresponding to each pixel;

[0018] Among them, the normal is determined as follows: use the intersection algorithm of a straight line and a unit sphere to find the intersection point of the outgoing direction projected by the perspective camera and the unit sphere, and the coordinates of this intersection point in the world coordinate system are the normal coordinates of this intersection point in the world coordinate system.

[0019] In one embodiment, the sampled BRDF sampling data is stored in a MERL binary file. In this MERL binary file, the BRDF sampling data is stored in the Rusinkiewicz coordinate system. Among them, the Rusinkiewicz coordinate system is a reparameterized coordinate system of the half-angle and difference angle calculated according to the incident and outgoing directions, which can reduce the storage space of BRDF data.

[0020] In one embodiment, interpolation processing is performed on the BRDF sampling data in the Rusinkiewicz coordinate system to uniform the BRDF sampling data in the Rusinkiewicz coordinate system.

[0021] In one embodiment, the method further includes: fitting a target shading model according to the BRDF sampling data of the object material.

[0022] To achieve the above-mentioned invention purpose, an embodiment also provides a device for obtaining the object material through the rendering result of a specific scene, including:

[0023] A scene building and setting module, used to build a scene and perform specific scene settings. Among them, the specific scene setting means that for all pixels obtained by rendering, the incident direction and the outgoing direction of the light source at the shading point corresponding to the pixel traverse the entire normal space hemisphere;

[0024] A rendering engine, used to render the incoming scene and specific scene settings to obtain a series of pictures;

[0025] A sampling module, used to uniformly sample a series of pictures to obtain the BRDF sampling data of the object material.

[0026] Compared with the prior art, the beneficial effects of the present invention include:

[0027] After passing through the scene and performing specific scene settings, render the scene and its specific scene settings to obtain a series of pictures. Then, by analyzing the series of pictures and performing uniform sampling of the BRDF, obtain the BRDF sampling data of the object material. The BRDF sampling data of the object material is presented in a general expression, facilitating the reuse of the object material in other rendering engines. Description of the Drawings

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0029] Figure 1 is a flowchart of the method for obtaining the object material through the rendering result of a specific scene provided by the embodiment;

[0030] Figure 2 is a schematic diagram of the specific scene settings provided by the embodiment;

[0031] Figure 3 is a set of pictures obtained by rendering provided by the embodiment;

[0032] Figure 4 is a schematic diagram of the conversion of the BRDF sampling data from the normal space to the Rusinkiewicz coordinate system provided by the embodiment;

[0033] Figure 5 Schematic diagram of the structure of the device for obtaining the object material through the rendering result of a specific scene provided by the embodiment. Detailed Embodiments

[0034] To make the purpose, technical solutions and advantages of the present invention clearer, the following further details the present invention in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not limit the protection scope of the present invention.

[0035] To solve the problem that the object materials of different rendering engines are not universal in the prior art, the embodiment provides a method for obtaining the object material through the rendering result of a specific scene. Figure 1 is a flowchart of the method for obtaining the object material through the rendering result of a specific scene provided by the embodiment. As Figure 1 shown, the method for obtaining the object material includes the following steps:

[0036] Step 1, set up the scene and perform specific scene settings.

[0037] In the embodiment, the specific scene setting means that in a series of scenes, for all pixels obtained by rendering, the incident direction and the outgoing direction of the light source at the shading point corresponding to the pixel traverse the entire normal space hemisphere, so that a complete sampling of the BRDF (bidirectional reflectance distribution function) can be obtained through rendering.

[0038] Among them, the BRDF is defined as the following four - variable function:

[0039]

[0040] Among them, are the incident direction and the outgoing direction respectively. Each direction can be represented by a unit vector or two angles in the spherical coordinate system. Therefore, the BRDF is a four - variable function. is the radiance in the outgoing direction. is the irradiance in the incident direction, and the BRDF is the ratio of the differentials of these two parameters. Among them, the radiance is a physical quantity describing the intensity per unit area of a light source for non - point light sources, defined as the radiant flux per unit solid angle in a specified direction and per unit area perpendicular to this direction. The irradiance is the power per unit area when electromagnetic radiation is incident on a curved surface.

[0041] Figure 2 The scene and the special scene setting proposed in the embodiment include a sphere located at the origin of the world coordinate system with a radius of 1 and pasted with an object material; a perspective camera located at the world coordinate (0, 0, 4), and the fov (field of view) of the camera is set to 45°; a parallel light source parallel to the yOz plane, which always points to the origin, and the angle between its direction and the z - axis changes from 0° to 180° at a fixed angular interval (for example, 0.5°). In this way, a picture is rendered every 0.5° change.

[0042] Step 2: Input the scene and the specific scene setting into the rendering engine, and a series of pictures are obtained through rendering.

[0043] In the embodiment, according to the special scene setting as Figure 2 shown, a part of the series of pictures obtained by rendering is as Figure 3 shown. From left to right and from top to bottom, they are the 40th, 80th, 120th, 160th, 200th, 240th, 280th, 320th, and 360th pictures respectively.

[0044] Analysis Figure 3It can be seen that the spherical image rendered by the perspective camera is a perfect circle. At this time, the normal vectors of the object surface at each point on this circle are different. Therefore, it can be regarded as traversing the outgoing direction under the condition of a fixed normal vector, that is, the outgoing direction traverses the entire hemispherical normal space.

[0045] At the same time, for a parallel light source, the incident light rays in the same direction hit different positions on the sphere with different normal directions. Therefore, it can be regarded as traversing the incident direction under the condition of a fixed normal vector, that is, the incident direction traverses the entire hemispherical normal space. At the same time, by rotating the orientation of the parallel light source, the two change processes are intertwined. Combining the two completes the traversal of the incident and outgoing directions of the entire hemispherical normal space.

[0046] In the embodiment, since the subsequent operations require sampling the rendering result as the sampling data of the BRDF, and the computer generally processes colors in the linear space, therefore, there is no need to perform gamma correction on the rendering result of the engine, and it can be directly stored in the linear space. In this embodiment, the rendered images of the engine are stored as a series of EXR pictures.

[0047] Step 3: By analyzing a series of pictures and performing uniform sampling of the BRDF, the BRDF sampling data of the object material is obtained.

[0048] In the embodiment, a set of BRDF samplings is a mapping from a set of incident directions and outgoing directions to BRDF values. The sampling process is actually the process of obtaining the incident direction and outgoing direction of the pixel points. The obtained BRDF sampling data includes the incident direction and the outgoing direction. In the embodiment, the method of uniform sampling is adopted, and by traversing all the pixels of this series of pictures, as much BRDF sampling data as possible is obtained.

[0049] In the embodiment, the following operations are performed on each pixel of each picture to complete one sampling: First, determine whether the pixel has a color, and directly skip the pixels without color and analyze the next pixel, and perform BRDF sampling on the pixels with color; for the incident direction of the BRDF, the incident directions of all pixel points in the same picture are the same in the world coordinates, that is, the direction of the parallel light source; for the outgoing direction of the BRDF, each pixel point in the same picture is different, but the pixel points at the same position on different pictures are the same. Based on this, to calculate the outgoing direction, only one ray projection similar to ray tracing needs to be performed, and the projection direction from the perspective camera to the center of the corresponding pixel on the virtual screen is used as the outgoing direction in the world space. The specific calculation process includes: for the pixel coordinates , the corresponding outgoing direction is:

[0050]

[0051]

[0052]

[0053] wherein respectively correspond to the left vector, up vector, and viewing direction vector of the camera is the camera field of view angle is the width and height of the image is the desired outgoing vector

[0054] Since the incident direction and outgoing direction in the BRDF refer to the directions in the normal space, it is also necessary to obtain the normal of the spherical surface corresponding to each pixel to convert the incident direction and outgoing direction in the world space into the incident direction and outgoing direction in the normal space. In the embodiment, an intersection algorithm of a straight line and a unit sphere is used to find the intersection point of the outgoing direction projected by the perspective camera and the unit sphere. Since it is a unit sphere, the coordinates of the intersection point in the world coordinate system are the normal coordinates of the intersection point in the world coordinate system. Based on this normal coordinate, the incident direction and outgoing direction in the world space can be converted into the incident direction and outgoing direction in the normal space

[0055] To facilitate the storage and use of BRDF sampling data, in the embodiment, the BRDF sampling data in the normal space is selected to be stored in a MERL (a BRDF data storage format proposed by Mitsubishi Electric Research Laboratories in 2003) binary file. The BRDF sampling data in the MERL file is stored in the Rusinkiewicz coordinate system. The Rusinkiewicz coordinate system is a reparameterized coordinate system of the half-angle and difference angle calculated according to the incident and outgoing directions, which can reduce the storage space of the BRDF data

[0056] The specific storage process includes: First, convert the incident direction and outgoing direction in the normal space obtained by sampling to the Rusinkiewicz space, that is, from Figure 4 the normal space coordinates shown in (a) of

[0057] to the Rusinkiewicz space coordinates shown in (b). A set of outgoing directions and incident directions in the Rusinkiewicz space can be described by only three angles description, is not required to be recorded, which is one angle less than the original four angles. This is because most BRDFs are isotropic, and the angle between the incident direction and the outgoing direction projected on the tangent plane is not important. What matters is their difference , thus, describing BRDF in the Rusinkiewicz space can reduce one dimension to decrease the data to be stored.

[0058] Figure 4 In , are the surface normal vector and the tangent vector, is the angular bisector direction of is the incident direction , the outgoing direction in the representation in the normal space, is the same incident direction , the outgoing direction in the representation in the Rusinkiewicz space.

[0059] In the embodiment, specifically, the conversion process includes:

[0060] First, the incident vector and the outgoing vector are converted to the corresponding at a tangent space of a point on the sphere through the TBN matrix, then the half-angle vector is:

[0061]

[0062] Thus, the azimuth angle of ) can be obtained.

[0063]

[0064]

[0065] The difference angle vector can be derived by the following formula:

[0066]

[0067] Where represents rotating the vector around the vector by , represents rotating the vector around the vector by , where is the normal vector of the tangent space, is the tangent vector of the tangent space. By rotating the incident vector by a certain angle, the difference angle vector is obtained, and the azimuth coordinate of is obtained.

[0068] Since the BRDF sampling data in normal space sampled from a series of pictures is not uniform after being transformed into Rusinkiewicz space, while the MERL file stores a set of BRDF data sampled uniformly in Rusinkiewicz space. Therefore, interpolation is needed to obtain the BRDF value corresponding to the Rusinkiewicz coordinates. In this embodiment, a Gaussian filter is selected to average the results sampled when storing the MERL file. Step 4: Fit the target shading model according to the BRDF sampling data of the object material.

[0069] In the embodiment, specifically, the fitting method can adopt the method described in the paper (Connecting Measured BRDFs to Analytic BRDFs by Data-Driven Diffuse-Specular Separation, Sun, Tiancheng and Jensen, Henrik Wann and Ramamoorthi, Ravi, ACM Transactions on Graphics (TOG)) to fit the BRDF sampling data in the MERL file to the target shading model. Of course, other fitting methods can also be adopted.

[0070]

[0071] Figure 5 Figure 5 The structural schematic diagram of the device for obtaining the object material through the rendering result of a specific scene provided by the embodiment. As shown, the device 500 provided by the embodiment includes:

[0072] A scene construction and setting module 510, which is used to construct the scene and perform specific scene settings. Among them, the specific scene setting means that for all pixels obtained by rendering, the incident direction and the outgoing direction of the light source at the shading point corresponding to the pixel traverse the entire normal space hemisphere;

[0073] A rendering engine 520, which is used to render the incoming scene and specific scene settings to obtain a series of pictures;

[0074] A sampling module 530, which is used to uniformly sample a series of pictures to obtain the BRDF sampling data of the object material.

[0075] ​It should be noted that when the device for obtaining the object material through the specific scene rendering result provided in the above embodiments obtains the object material, the above-described functional modules should be used as examples for illustration. The above functions can be allocated to different functional modules according to needs, that is, the internal structure of the terminal or server is divided into different functional modules to complete all or part of the functions described above. In addition, the device for obtaining the object material through the specific scene rendering result provided in the above embodiments and the method embodiment for obtaining the object material through the specific scene rendering result belong to the same concept. For the specific implementation process, please refer to the method embodiment for obtaining the object material through the specific scene rendering result, which will not be elaborated here.

[0076] The above specific implementation manners have elaborated in detail the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not used to limit the present invention. Any modifications, supplements, equivalent replacements, etc. made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for obtaining the material of an object through the rendering result of a specific scene, characterized in that, Including the following steps: Construct a scene and perform specific scene settings. Here, the specific scene settings mean that for all pixels obtained by rendering, the incident direction and the outgoing direction of the light source at the shading point corresponding to the pixel traverse the entire normal space hemisphere; Input the scene and the specific scene settings into the rendering engine to obtain a series of pictures through rendering; By analyzing a series of pictures and performing uniform sampling of the BRDF, obtain the BRDF sampling data of the object material, including: traversing each pixel of each picture and screening the pixels with colors for BRDF sampling; for the incident direction of the BRDF, the incident directions of all pixel points in the same picture are the same in the world coordinate system, which is the direction of the parallel light source; for the outgoing direction of the BRDF, each pixel point in the same picture is different, but the pixel points at the same position on different pictures are the same. Based on this, to calculate the outgoing direction, only one ray casting like ray tracing needs to be done, and the projection direction from the perspective camera to the center of the corresponding pixel on the virtual screen is used as the outgoing direction in the world space. Among them, the incident direction and the outgoing direction of each pixel point form the BRDF sampling data; Since both the incident direction and the outgoing direction in the BRDF refer to the directions in the normal space, it is also necessary to obtain the normal of the spherical surface corresponding to each pixel to convert the incident direction and the outgoing direction in the world space into the incident direction and the outgoing direction in the normal space; When the scene is a unit sphere with a radius of 1, convert the BRDF sampling data obtained by uniform sampling from the world space to the normal space, including: converting the incident direction and the outgoing direction in the world space into the incident direction and the outgoing direction in the normal space according to the normal of the spherical surface corresponding to each pixel; Among them, the determination method of the normal is: use the intersection algorithm of a straight line and a unit sphere to find the intersection point of the outgoing direction projected by the perspective camera and the unit sphere, and the coordinates of this intersection point in the world coordinate system are the normal coordinates of this intersection point in the world coordinate system.

2. The method for obtaining the material of an object based on the rendering result of a specific scenario according to claim 1, wherein The constructed scene includes a sphere located at the origin of the world coordinate system, with a radius of r and pasted with the object material, a perspective camera, and a parallel light source parallel to the yOz plane. All parallel light sources always point to the origin, and the angle between its direction and the z-axis changes from 0° to 180° at a fixed angular interval.

3. The method for obtaining the object material through the rendering result of a specific scenario according to claim 1, characterized in that, The series of pictures obtained by rendering are pictures in the EXR format, which is convenient for subsequent sampling.

4. The method for obtaining the object material through the rendering result of a specific scenario according to claim 1, characterized in that, Store the sampled BRDF sampling data in a MERL binary file. In this MERL binary file, the BRDF sampling data is stored in the Rusinkiewicz coordinate system.

5. The method for obtaining the object material according to the rendering result of a specific scenario as claimed in claim 4, wherein, Perform interpolation processing on the BRDF sampling data in the Rusinkiewicz coordinate system to uniform the BRDF sampling data in the Rusinkiewicz coordinate system.

6. The method for obtaining an object material according to the rendering result of a specific scene as claimed in claim 1, wherein It also includes: Fitting a target shading model according to the BRDF sampling data of the object material.

7. An apparatus for obtaining an object material through a specific scenario rendering result, characterized in that, Including: A scene construction and setting module for constructing a scene and performing specific scene settings. Here, the specific scene settings mean that for all pixels obtained by rendering, the incident direction and the outgoing direction of the light source at the shading point corresponding to the pixel traverse the entire normal space hemisphere; A rendering engine for rendering the incoming scene and specific scene settings to obtain a series of images; A sampling module for uniformly sampling a series of images to obtain BRDF sampling data of object materials, including: traversing each pixel of each image and screening the pixels with colors for BRDF sampling; for the incident direction of the BRDF, the incident directions of all pixel points of the same image in the world coordinate system are the same, which is the direction of the parallel light source; for the outgoing direction of the BRDF, each pixel point of the same image is different, but the pixel points at the same position on different images are the same. Based on this, to calculate the outgoing direction, only one ray casting similar to ray tracing is required, and the projection direction from the perspective camera to the center of the corresponding pixel on the virtual screen is used as the outgoing direction in the world space. Among them, the incident direction and the outgoing direction of each pixel point form the BRDF sampling data; Since both the incident direction and the outgoing direction in the BRDF refer to the directions in the normal space, it is also necessary to obtain the normal of the spherical surface corresponding to each pixel to convert the incident direction and the outgoing direction in the world space into the incident direction and the outgoing direction in the normal space; When the scene is a unit sphere with a radius of 1, the BRDF sampling data obtained by uniform sampling is converted from the world space to the normal space, including: converting the incident direction and the outgoing direction in the world space into the incident direction and the outgoing direction in the normal space according to the normal of the spherical surface corresponding to each pixel; Among them, the method for determining the normal is: using the intersection algorithm of a straight line and a sphere to find the intersection point of the outgoing direction projected by the perspective camera and the unit sphere, and the coordinates of this intersection point in the world coordinate system are the normal coordinates of this intersection point in the world coordinate system.

Citation Information

Patent Citations

  • Luminosity diagram-based geometry and surface material reconstructing method

    CN102819864A

  • A material acquisition method and system based on neural network

    CN108985333A

  • Rendering method based on indirect reflection highlight calculation in screen space

    CN105261059A