Thin Film Shader

薄膜着色器

Basic 基础Shader 着色器

Thin Film Shader

薄膜着色器

General

常规

Shimmering soap bubbles (here with varying 闪亮的肥皂泡沫(这里有不同的Thickness (mm) 厚度(毫米)) and anti-reflection coat (note the fingerprint, which itself is a Thin Film) on lenses are easy to create using the Thin Film shader. )和减反射涂层(注意指纹,这本身就是一个薄膜)镜头很容易创建使用薄膜着色

You might wonder why all colors of the spectrum shimmer in surfaces of soap bubbles, oil film on water, mother of pearl, etc. The reason this happens is a special physical effect referred to as ,thin film’ or ,interference’ effect. This effect occurs on very thin transparent surfaces whose thickness is approximately that of the wavelength of visible light (around 500 nm). The light is reflected by both front and back sides of the film:

你可能想知道为什么所有颜色的光谱在肥皂泡沫、水面油膜、珍珠母等表面闪烁。发生这种现象的原因是一种特殊的物理效果,称为“薄膜”或“干涉”效果。这种效果发生在非常薄的透明表面,其厚度大约是可见光的波长(约500纳米)。光线被胶片的正面和背面反射:

Both reflecting light rays overlap resulting in an interference. 两条反射光线重叠造成干涉

Both reflected rays overlap (interfere) and the difference in paths produces an amplification and attenuation of the waves, i.e., changes in color.

两种反射光线重叠(干涉) ,路径的不同产生了波的放大和衰减,也就是说,颜色的变化。

These changes in color are dependent primarily on the following properties:

这些颜色的变化主要取决于以下特性:

Minor modifications to these properties will result in major changes to the rendered result.

对这些属性的微小修改将导致对所呈现结果的重大更改。

The Thin Film shader, if implemented, works physically correct as described below, i.e., if you want to render realistic-looking results you have to create realistic lighting setups (e.g., by using a Physical Sky, luminous reflectors).

薄膜着色器,如果实现了,工作物理上正确如下所述,也就是说,如果你想渲染出逼真的效果,你必须创建逼真的照明设置(例如,使用物理天空,发光反射器)。

Implementation

实施

The Thin Film shader can be loaded into any material channel, just as any other shader can. It will only work physically correct if it is loaded into a Reflectance channel’s Texture field (preferably in a Beckmann or GGX layer) in the channel’s Layer Color menu. Specular layers should be disabled.

薄膜着色器可以加载到任何材质通道,就像任何其他着色器可以。它只会工作的物理正确,如果它加载到一个反射通道的纹理领域(最好在贝克曼或 GGX 层)通道的图层颜色菜单。镜面层应该被禁用。

For soap bubbles, the Transparency channel should also be enabled and its Additive enabled.

对于肥皂泡,也应该启用透明通道,并启用其添加剂。

Open the following scene to see an example:

打开下面的场景看一个例子:


In General, the following applies: To get the most out of this effect you should make sure that suitable reflective objects are used; HDRI textures can be applied to a Sky Object or layers with luminous materials can be used.

一般来说,以下应用: 为了得到最好的效果,你应该确保使用合适的反射对象; HDRI 纹理可以应用于天空对象或层与发光材质可以使用。

Tip: 提示:
Note that the thin film effect can also be used on materials such as leather, rubber and metals, etc. 请注意,薄膜效果也可用于材质,如皮革,橡胶和金属等