Blend material

Description

../../../_images/blend.jpg

Example of blend material between a metal and diffuse clay

Material This special materials does blends, or linear combinations, of two other materials, following a user-defined blend function varying between 0 and 1. This is often used for mixing materials (for instance, with a constant blend function equal to 0.5), or for defining areas with different materials (with a blend function taking only 0 and 1 values).

Children Nodes

Material material_a The material A
Material material_b The material B
Scalar shader blend The blend function defining the ratio of materials A and B, 0 corresponding to A and 1 to B

Parameters

name type description
forcestep boolean If set to true, apply a step function to the blend shader with a threshold of 0.5 to force 0 and 1 values

Ocean XML 3.0 example

<material type="blend" name="previewmaterial" forcestep="false">
   <material type="reflective" name="material_a" rereflections="true" polarized="true">
      <intlaw type="cfresnel" name="intlaw">
         <medium type="linked" name="medium" target="ocean-metals::Ti"/>
      </intlaw>
      <roughness type="phong" name="roughness">
         <scalarshader type="uniform" name="exponent" value="500"/>
      </roughness>
   </material>
   <material type="oren_nayar" name="material_b">
      <filtershader type="uniform" name="diffuse">
         <spectrum type="tabulated" start="380E-9" end="780E-9" num="8">
            0.2 0.25 0.3 0.35 0.5 0.6 0.7 0.7
         </spectrum>
      </filtershader>
      <scalarshader type="uniform" name="sigma" value="1"/>
   </material>
   <scalarshader type="texture" name="blend" greypt="0.5">
      <image type="" name="image" path="gradient.png"/>
   </scalarshader>
</material>