Volumes

ボリュームのレンダリングは炎、煙、霧、ガラスによる光の吸収等、サーフェスのメッシュのみでは表現できない効果のために用いることができます。

ボリュームを設定するため、その中にボリュームが存在するという境界を定めるメッシュを作ります。マテリアルでは通常 Surface ノードを削除して代わりに Volume ノードを用意してボリューム内のシェーディングを定義します。ガラスが吸収する光といった効果のためにサーフェスシェーダーとボリュームシェーダー両方を用いることもできます。ワールドに対して霧のような効果を持たせるためにボリュームシェーダーを用いることもできます。

Shading

Principled Volume

Principled Volume is a physically-based volume shader that can be used to create a wide range of volume materials. It supports scattering, absorption and emission in one easy to use node. Fire can be rendered with blackbody emission.

../../../_images/render_cycles_materials_volume_principled.jpg

Smoke and fire rendered with Principled Volume shader.

Volume Components

For more control, volume shading components can be manually combined into a custom shader setup.

  • Volume Absorption will absorb part of the light as it passes through the volume. This can be used to shade for example black smoke or colored glass objects, or mixed with the volume scatter node. This node is similar to the transparent BSDF node, it blocks part of the light and lets other light pass straight through.
  • Volume Scatter lets light scatter in other directions as it hits particles in the volume. The anisotropy defines in which direction the light is more likely to scatter. A value of 0 will let light scatter evenly in all directions (similar to the diffuse BSDF node), negative values let light scatter mostly backwards, and positive values let light scatter mostly forward. This can be used to shade white smoke or clouds for example.
  • Emission will emit light from the volume, for example for fire.
../../../_images/render_cycles_materials_volume_node.jpg

Volume Absorption, Scatter and Emission

Attributes

When rendering smoke and fire, volume attributes are used to define the shape and shading of the volume. The Principled Volume shader will use them by default, while custom volume shaders can use the Attribute node to get attributes such as density, color and temperature.

Density (密度)

全てのボリュームシェーダーは Density の入力を持ちます。Density はどれだけの光がボリュームと、吸収や拡散として、反応するかを定義し、どれだけが通過するかを定義しています。煙のような効果を得るためには Density の値を、煙が存在してどの程度であるか (Density は 0 より大きな値) と、煙が存在しない (Density は 0) との間でどれだけの値にするかを設定することになるでしょう。

Volumes in the real world consist of particles, a higher density means there are more particles per unit volume. More particles means there is a higher chance for light to collide with a particle and get absorbed or scattered, rather than passing straight through.

Mesh Volumes

ボリュームレンダーに用いるメッシュは閉じた状態でありかつ manifold (多様体) でなければなりません。これはそのメッシュ状に穴が無いことを意味します。辺は厳格に 2 つの面に繋がっていて穴や一つの辺に 3 つ以上の面が繋がった状態で T 字型の面となっている箇所があってはいけません。

正しい結果を得るため法線は外側を向いている必要が有ります。法線はボリュームに対して光が出入りする方向を決め、もしその方向が間違っていたり、メッシュ上に穴がある場合、レンダラーはボリュームの内側と外側を決定する事ができなくなります。

これらのルールはガラスの屈折を正しくレンダリングする際も同様です。

World Volume

A volume shader can also be applied to the world, filling the entire space.

現状では、ワールドに対してボリュームシェーダが用いられている場合はサーフェスシェーダーや Sun 光源が何の効果も持たないため、夜景やその他暗いシーンの表現に最も有用です。これはワールドの背景が、例えば日光が実際にそうであるように、無限遠に存在するとされるためです。しかし、霧や空気中の拡散の効果をモデリングする上では、太陽と地球間の空間の大半は空っぽの空間である事から分かるように、ボリュームが空間全てを等しく満たすというのは好ましくない前提です。こういった効果を表現するにはシーンの環境のためのボリュームを作成したほうが良いでしょう。そのオブジェクトの大きさによってどれだけ光を拡散もしくは吸収するのかが決まります。

Multiple Scattering

Real-world effects such as scattering in clouds or subsurface scattering require many scattering bounces. However, unbiased rendering of such effects can be noisy, so by default the number of bounces is zero. The effect you get when rendering with zero volume bounces is what is known as "single scattering", the effect from more bounces is "multiple scattering".

For rendering materials like skin or milk that require multiple scattering, subsurface scattering is more efficient and easier to control. Particularly the random walk method can accurately render such materials.

雲や煙といったマテリアルではボリュームレンダリングが必要とする、明確なサーフェスを持っていません。こういった表現では多くの拡散光のバウンスを利用する事で最も外見的に良い結果を得られるのですが、許容できるレンダー時間を維持するために実際にはバウンスの回数を 1 回とします。

制限

GPU では利用できない機能:

  • Multiple importance sampling for efficient lights inside volumes.