# Switch BSDF¶

## Description¶

Example of switch BSDF between a metal and diffuse clay

This special BSDF switches between other BSDFs, following a user-defined switch function varying between 0 and 1. This is often used for defining areas with different BSDFs on the same surface.

For instance, if five child BSDFs are defined, they will be activated when the blend function has a value:

• Between 0 and 0.2 for the BSDF n°1

• Between 0.2 and 0.4 for the BSDF n°2

• Between 0.4 and 0.6 for the BSDF n°3

• Between 0.6 and 0.8 for the BSDF n°4

• Between 0.8 and 1 for the BSDF n°5

Note

Before Ocean 2017 R2, this was described by a Blend BSDF with the parameter forcestep set to true

## Children Nodes¶

 switch The switch function selecting the BSDF, between 0 (first bsdf) and 1 (last bsdf) user-defined First BSDF user-defined Second BSDF user-defined …

none

## Ocean XML 6.1 example¶

<bsdf type="switch" name="bsdf">
<prm channel="G"/>
<prm scale="1"/>
<prm offset="0"/>
<prm greypt="0.5"/>
<prm uvscale="1"/>
<bsdf type="reflective" name="bsdf1" rereflections="true">
<roughness type="phong" name="roughness">
</roughness>
<intlaw type="cfresnel" name="intlaw">