• 沒有找到結果。

Material Creation Flow

Material Design Systemrefine

3.3 Material Creation Flow

3.3 Material Creation Flow

In this section, we describe how we obtain all the texture maps we need for our representation and how we use the textures and design system to enhance the design of a material. The material creation flow can be separated into three main parts: Geometry Part, Diffuse Part and Specular Part.

3.3.1 Geometry Part

Some materials may contain self-shadowing and parallax effects due to its meso-geometry. To obtain meso-geometry information without the BTF data, we can either use photometric stereo (more than one images) or use grayscale of the image (single image) to get the approximated height map and normal map (Figure 3.5).

Images from

Figure 3.5: The creations of normal map and height map. Left: Photometric Stereo. Right:

grayscale approximation.

3.3 Material Creation Flow 17

For the photometric stereo, the method assumes the material as a Lambertian surface and illuminated from a distant small source. The normal can be solved by inverting the linear equation:

I = N · L, (3.3)

where I is a vector of the intensities for a pixel in m images, N is the surface normal, and L is a 3 by m matrix of normalized lighting directions. The normal integration method proposed by Frankot and Chellappa is then applied to recover the height map [FC88].

For materials with less specular and similar colors, using grayscale of the image can produce approximated meso-geometry quite well. To use the grayscale of an image as the height map, it is important that the material is lit evenly from any direction to avoid the shadowing effect and specular effect. Thus the intensity of a texture would be highly corresponding to the ambient occlusion rate (the darker the deeper) and hence can be used to approximate the height map.

GIMP already has a plugin that can be utilized to generate the normal map from a height map.

However, the approximated geometry may not be accurate. Artists may also wish to make the material smoother or rougher. For these purposes, the ability to edit the geometry is necessary.

To keep the consistency between the normal and height field, users have to manually rebuild the normal map via GIMP plugin every time when the height map is changed. To solve this problem, we actually store the height map only and calculate the normal map using 3 × 3 Sobel filters at runtime (Figure 3.6). By convoluting the height map with the Sobel filters, we can get the derivative of the x direction (dx) and the derivative of the y direction (dy). The derivative of the z direction (dz) can be calculate via 1 −p(dx2+ dy2). Thus the normal at a pixel would be (dx, dy, dz). However, artists may wish to strengthen the geometry feature, so we actually get our normal by normalizing the vector (dx, dy, 1.0/N ormalStrength) with N ormalStrength ranges between 1.0 to 8.0. Since we calculate the normal map at runtime, user can see the changes on the fly without manually rebuilding the normal map.

For the wallpaper sample, the height map using grayscale of the image is not quite accurate.

From the observation of the wallpaper BTF data, we know that the meso-geometries are all the same over the surface. The white area and the golden part in the middle should have the same

3.3 Material Creation Flow 18

meso-geometry as the periphery. Thus we use “clone tool” of GIMP to clone the height field of the periphery to the middle part as shown in Figure 3.7.

Height Map Normal Map

Figure 3.6: Converting height map to normal map using 3 × 3 Sobel filter.

Editing Sobel3x3

Height Map Height Map Normal Map

Figure 3.7: Using “clone tool” to edit the height map. The contrast of the height map is en-hanced for better observation.

3.3.2 Diffuse Part

For the diffuse part, we assume the surface is perfectly diffuse that scatters incident light uni-formly in all directions. Thus we use the same image which we take for the geometry part as our diffuse color map. Usually we will decrease the intensity of the diffuse color map to exclude the specular intensity. Editing may be applied to further modify the results (Figure 3.8).

3.3 Material Creation Flow 19

Decrease

Intensity Editing

Original Image Initial Diffuse Color Map Final Diffuse Color Map

Figure 3.8: The process for generating the diffuse color map.

3.3.3 Specular Part

Index Map The specular part of our representation consists of an index map, a specular mask map, a Fresnel map, a tilted reflection map and a few specular color maps. From the observa-tions of the index maps for different materials in [MG09], we found that the regions which have similar diffuse colors share the same index. Thus we can use color selection tool, edge detec-tion, color mapping/remapping tools or any other image processing tools of GIMP to separate the image into similar parts easily. The segmented parts are then indexed by an index map.

Each channel of the index map represents the weight for each specular color map (Equation 3.4). For example, in the index map of the wallpaper, as shown in Figure 3.4, the pure red region corresponds to specular color 1 and pure green region corresponds to specular color 2,..., and so on.

Cs= IndexM ap.r × Cs 1+ IndexM ap.g × Cs 2+ IndexM ap.b × Cs 3 (3.4) Specular Maps After the segmentation, the next step would be the design of the specuar color map for each region. As stated in Section 3.2, we store the specular color in a parabolic map that is accessed by using the half vector. Although using half vector for deciding the specular color is much easier, it would still be too difficult for artists to design the parabolic map. It is not clear for artists to be aware which texel of the parabolic map is accessed for a given lighting and viewing directions. To tackle this problem, our system provides a special design window which has nine viewports showing the results of different lighting and viewing direction over the upper

3.3 Material Creation Flow 20

hemisphere (Figure 3.9). Each viewport corresponds to a different phi angle (Figure 3.10) of the lighting and viewing directions, allowing artists to change the theta of lighting and viewing directions. To let the artist acknowledge which pixel of the specular color map corresponds to the current lighting and viewing directions, we mark it as red points at the “Specular Position”

block at the bottom right. Artist can draw the parabolic map and get the feedback right away in real-time with the corresponding pixels of the specular color map under different lighting and viewing direction indicated.

Figure 3.9: Design interface for specular maps.

3.3 Material Creation Flow 21

x y z

ψ θ

Figure 3.10: The indications of theta and phi angle.

Specular Mask Map The obtained specular color map would be multiplied with the specular mask map to control its intensity. Generally, for a material that is lit evenly from any direction, a position that has a higher intensity value tends to have a lower ambient occlusion rate or a higher reflection rate. Thus we use the intensity of the diffuse color map as the initial specular mask map and change the brightness and contrast via our design system for better results (Figure 3.11).

Grayscale Specular Mask Map

Fresnel Map Adjust

Brightness, Contrast Original Image

Figure 3.11: The process to get the specular mask map and Fresnel map.

3.3 Material Creation Flow 22

Fresnel Map The Fresnel term expresses the reflection of light on material, which Schlick’s Frensel is used. The Fresnel term increases from r0to 1 as the angle between L and H increases from 0 to 90 degree (Figure 3.12). Hence the material will become brighter when it is illumi-nated at the grazing angle and viewed from the opposite side (Figure 3.13 left). Similar to the creation of the specular mask map, we also use the intensity of the diffuse color map as the initial Fresnel map and change the brightness and contrast for better results (Figure 3.11).

Fresnel

degree of angle between L and H

0

Figure 3.12: The graph of the Fresnel term to the angle degree between L and H (with r0 = 0.5).

Tilted Reflection Map Besides the tilted reflection case as shown in Figure 3.13 left, the material should also appear brighter when it is illuminated at the grazing angle and viewed from the same side (Figure 3.13 right). However, this effect is not described in the Fresnel term.

No matter how tilted the lighting and viewing directions are, as long as they are the same, the Fresnel term would be all the same since it only depends on the degree between L and H. To enhance these kinds of lighting effects, Ashikhmin’s distribution-based BRDF [Ash06] divides the specular part by (L · N + V · N − (L · N )(V · N )). The shape of the divisor is shown in Figure 3.14. The divisor ranges between 0 and 1, thus the specular will be amplified when either the angle between lighting direction and the normal or the angle between viewing direction and the normal becomes larger. Considering the design purpose for unreal materials for gaming and

3.3 Material Creation Flow 23

L V L

V

Figure 3.13: Two cases that make a material appear brighter. Usually the case at the left is brighter than the case at the right.

L dot N

V dot N

Figure 3.14: The shape of (L · N + V · N − (L · N )(·N )). Adopted from [Ash06].

3.3 Material Creation Flow 24

animation industry, artists may wish to further control this amplified phenomenon. Thus we store the value of cos(θ), given θ from 0 to 90, as a 91 × 1 texture. Given L · N or V · N , we first calculate the angle using arccos then use it as the texture coordinate to access the value of the dot product which stores in the texture (Figure 3.15). Linear filter is applied to the texture to linearly interpolate the value between each texel. For more intuition (the whiter the brighter), we store 1 − cos(θ) in the texture instead of cos(θ). Artists can use the default button to set the value of 1 − cos(θ) to the texture and use the “Adjust Color Curves” tool to easily edit the slope (Figure 3.16).

‧‧‧

θ = 0 1 2 3 4 5 ‧‧‧ 85 86 87 88 89 90 L or V N

θ

1-cos(θ) =

Set to default

Figure 3.15: The meaning of tilted reflection map. We store the value of the dot product in the texture, allowing user to control the phenomenon of tilted reflection (we store 1 − cos(θ) instead of cos(θ)).

3.3 Material Creation Flow 25

Tilted Reflection Map Tilted Reflection Map

Figure 3.16: Using “Adjust Color Curves” tool to change the reflection at grazing angle. Left:

default settings. Right: specify the tilted reflection starting at the lower angle).

Rotation Map Up to now, we can handle general anisotropic materials and isotropic materi-als. But when dealing with some special materials whose specular changes continuously over the phi angle (e.g., watch (Figure 3.17)), it would be hard to use some discrete specular colors for approximation. To solve this problem, rotation map is introduced. Each texel of the Rotation map stores the rotation of the corresponding specular color map (Figure 3.18). The rotation is encoded as hue in HSV color space. Some may consider why not use a gray scale image which maps 0-255 to 0-359 degree to encode the rotation angle. The reason is that, when considering the mipmap filtering, the rotation degree would be wrong in some cases. For example, given 4 pixels in which all the top pixels are 0 degree and all the bottom pixels are 359 degree (Figure 3.19). The filtered color between 0 degree and 359 degree would be 180 degree which is far

3.3 Material Creation Flow 26

Figure 3.17: The anisotropic reflection of a watch.

Index Map Specular Color Map Rotation Map

45°

HSV color space Rotated Specular Color Map

Figure 3.18: The meaning of the rotation map.

3.3 Material Creation Flow 27

Figure 3.19: Filtering process of different rotation map representations.

from either 0 or 359 degree. However, if we store the degree as hue in HSV color space, the color of 0 degree and the color of 359 degree are almost identical, thus we have the correct degree after filtering. On the other hand, the color selection interface of GIMP provides the information of HSV and the corresponding RGB color at the same time (Figure 3.20). This really breaks the gap for user to understand which color corresponding to which degree and vice versa. However, drawing a rotation map that rotates around the center is really difficult. To solve this problem, we provide a button which can draw a 360 rotation around the center of a region specified by the users (Figure 3.21).

相關文件