简介

A material defines the artistic qualities of the substance that an object is made of. In its simplest form, you can use materials to show the substance an object is made of, or to "paint" the object with different colors. Usually, the substance is represented by its surface qualities (color, shininess, reflectance, etc.) but it can also exhibit more complicated effects such as transparency, diffraction and subsurface scattering. Typical materials might be brass, skin, glass, or linen.

Materials can also contain displacement information to described how the material raises and lowers the surface of the material.

../../../_images/render_blender-render_materials_introduction_demo.jpg

Various basic materials (single, multiple material, transparency, vertex paint).

The basic (un-textured) Blender material is uniform across each face of an object (although the various pixels of each face of the object may appear differently because of lighting effects). However, different faces of the object may use different materials (see Multiple Materials).

In Blender, materials can (optionally) have associated textures. Textures describe the substance: e.g. polished brass, dirty glass or embroidered linen. The Textures chapter describes how to add textures to materials.

How Materials Work

Before you can understand how to design effectively with materials, you must understand how simulated light and surfaces interact in Blender's rendering engine and how material settings control those interactions. A deep understanding of the engine will help you to get the most from it.

The rendered image you create with Blender is a projection of the scene onto an imaginary surface called the viewing plane. The viewing plane is analogous to the film in a traditional camera, or the rods and cones in the human eye, except that it receives simulated light, not real light.

To render an image of a scene we must first determine what light from the scene is arriving at each point on the viewing plane. The best way to answer this question is to follow a straight line (the simulated light ray) backwards through that point on the viewing plane and the focal point (the location of the camera) until it hits a renderable surface in the scene, at which point we can determine what light would strike that point.

The surface properties and incident light angle tells how much of that light would be reflected back along the incident viewing angle (Rendering engine basic principle).

../../../_images/render_blender-render_materials_introduction_basic-principle.svg

Rendering engine basic principle.

Two basic types of phenomena take place at any point on a surface when a light ray strikes it: diffusion and specular reflection. Diffusion and specular reflection are distinguished from each other mainly by the relationship between the incident light angle and the reflected light angle.

The shading (or coloring) of the object during render will then take into account the base color (as modified by the diffusion and specular reflection phenomenon) and the light intensity.

Using the internal ray tracer, other (more advanced) phenomena could occur. In ray-traced reflections, the point of a surface struck by a light ray will return the color of its surrounding environment, according to the rate of reflection of the material (mixing the base color and the surrounding environment's) and the viewing angle.

On the other hand, in ray-traced refractions, the point of a surface struck by a light ray will return the color of its background environment, according to the rate of transparency (mixing the base color and the background environment's along with its optional filtering value) of the material and the optional index of refraction of the material, which will distort the viewing angle.

Of course, shading of the object hit by a light ray will be about mixing all these phenomena at the same time during the rendering. The appearance of the object, when rendered, depends on many interrelated settings:

  • World (Ambient color, Radiosity, Ambient Occlusion)
  • Lights
  • Material settings (including ambient, emission, and every other setting on every panel in that tab)
  • Texture(s) and how they are mixed
  • Material Nodes
  • Camera
  • Viewing angle
  • Obstructions and transparent occlusions
  • Shadows from other opaque/transparent objects
  • Render settings
  • Object dimensions (SS settings are relevant to dimensions)
  • Object shape (refractions, Fresnel effects)

Using Materials

Tip

Check your Render

When designing materials (and textures and lighting), frequently check the rendered appearance of your scene, using your chosen render engine/shader settings. The appearance might be quite different from that shown in the texture display in the 3D panel.

As stated above, the material settings usually determine the surface properties of the object. There are several ways in which materials can be set up in Blender. Generally speaking, these are not compatible. You must choose which method you are going to use for each particular object in your scene:

  1. First, you can set the Properties in the various Material panels.
  2. Second, you can use Nodes; a graphical nodes editor is available.
  3. Last, you can directly set the color of object surfaces using various special effects. Strictly speaking, these are not materials at all, but they are included here because they affect the appearance of your objects. These include Vertex Painting, Wire Rendering, Volume Rendering, and Halo Rendering.

The exact effect of Material settings can be affected by a number of system settings. First and foremost is the renderer used: Cycles and the Blender Renderer (aka Blender Internal or BI) require quite different illumination levels to achieve similar results, and even then the appearance of objects can be quite different. Also, the material properties settings can be affected by the texture method used (single-texture, multi-texture or GLSL). So it is recommended to always select the appropriate system settings before starting the design of materials.

../../../_images/render_cycles_materials_introduction_shaders.svg

表面着色器

表面着色器定义了网格表面的光线交互状态。

See also

表面着色器

体积着色器

当表面着色器既不反射也不吸收光线时,光线会进入到物体内部。如果不指定任何的体积属性,它将直接穿透到达网格的另一头。

如果进行了定义,那么一个体积着色器就会对光线经过物体内部时的作用效果进行说明。光线可能会被散射、吸收或是照亮内部的任意点。

一个材质可以同时具有表面着色器和体积着色器属性,或是只含其一。同时使用二者时,有助于表现如玻璃、水或冰块等材质。例如,当你需要一部分光在穿过物体被吸收,兼具玻璃着色器和光泽着色器属性的表面的情况。

See also

体积着色器

置换着色器

表面以及内部的形状可以通过置换着色器改变。用这种方式,贴图可以让网格表面的细节程度得到增强。

如果设置得当,置换效果可以只调节表面法线即可虚拟呈现效果,也就是传说中的凹凸贴图,又或者实现虚实结合的置换效果。

See also

置换着色器

能量守恒

材质系统是基于物理渲染思想的基础上建立的,将材质的感官形式与所用的渲染算法进行泾渭分明的划分。这样做会比较易于获得逼真的效果以及均衡的光照,不过需要注意几点。

为了能够让材质在全局光中取得理想的效果, 用户应该遵循物理原则,质能守恒定律。这意味着,物体所反射的光量不能多于入射的光量。这种属性并没有强制限定,但如果色彩值在0.0-1.0之间,并且 BSDF 着色器只通过Mix Shader(混合着色器)结点进行混合的话,那么结果就是正确的。

然而,这种情况则例外:当色彩值高于1.0,或者使用了Add Shader(叠加着色器)结点的时候,你必须谨慎操作,确保材质的效果在各种光照情况下都在预料之内。因为这种情况下会导致在系统中每当光线被反射时都会被多反射一次,使得 BSDF 着色器呈现出一种类似于自发光的效果。