There are various ways to create fog in OctaneRender®. The simpliest method is to add  a Medium node to the Medium pin on the Daylight or Texture Environment node. In figure 1, A Volume Medium and a Scattering node are connected to a Medium Switch node to provide the ability to switch between each medium type connected to the Daylight Environment's Medium pin. The Post Processing Volume Effects can also produce fog effects with minimal effort. Please see the Post-Processing Node topic for more information. 



Daylight Medium Nodes




Figure 1: Medium nodes connnected to the Medium pin on a Daylight Environment node

 


The disadvantage of this simple method is that it does not provide much control over the density of the fog volume from foreground to background. VDB nodes provide more control over the fog density with scene depth. The Volume node and the Unit Volume node found under the Geometry category in the Node Graph Editor can be used to generate VDB volumes. The Unit Volume node is a convenient way to add volume to the scene without having to import a VDB file from another appllication. In figure 2, a cube VDB has been inmported using the Volume node and a Unit Volume node has also been added. The nodes are attached to a Geometry Switch node so comparisions can be made between the two volume fog results. Figures 3 and 4 show a camparison between the imported VBD and the Unit Volume results.



Unit Volume And VBD Nodes




Figure 2: Adding an imported VBD and a Unit Volume node using the Geometry Switch node



VDB Import




Figure 3: The imported VBD result as volume fog



Unit Volume




Figure 4: The Unit Volume result as a volume fog


There is no standard setting for using a VDB file because the settings depends a lot on the volume geometry's size, the most important attributes to tweak are the Density and the Volume Step Length. Check the maximum values for Absorption, Scattering, and Emission that is in the VDB itself. For the example above, those values are less than 0.2, 0.2, 0.2, respectively (figure 5).



Import VDB Attributes




Figure 5: Absorption, Scattering, and Emission attributes

 


Considering the size (e.g., abs/scat/emis: 0.141,0.141,0.141) is important if you want to use some Absorption and Scattering ramps because the ramps will have a Max Value attribute and this should not be greater than the size of the imported volume (figure 6). This produces a more believeable and accurate fog result (figure 7).



Volume Gradient Max Value




Figure 6: The Absorption and Scattering Volume Gradient settings

 


Volume Gradient Results




Figure 7: The scene results from the settings in Figure 6