<?xml version="1.0"?>
<implementation render="Generic">
  <language name="Protein" version="2.0"/>
  <api name="Protein" version="2.0"/>
  <root_bindings name="root"/>

  <constants>
    <boolean name="hardwood_color_by_object"                val="false"/>
    <boolean name="hardwood_is_metal"                       val="false"/>
    <float   name="hardwood_transparency"                   val="0.0"/>
    <float   name="hardwood_transparency_image_fade"        val="1."/>
    <float   name="hardwood_refraction_index"               val="1.4"/>
    <float   name="hardwood_refraction_translucency_weight" val=".5"/>
    <float   name="hardwood_cutout_opacity"                 val="1.0"/>
    <boolean name="hardwood_backface_cull"                  val="false"/>
    <float   name="hardwood_self_illum_luminance"           val="0.0"/>
    <float   name="hardwood_self_illum_color_temperature"   val="0.0"/>
    <integer name="hardwood_refraction_glossy_samples"      val="1"/>
  </constants>

  <operator function="HardwoodBrdf0DegreeReflBOF" name="brdf_0_degree_refl">
    <map_interface source="hardwood_finish"     destination="finish"/>
  </operator>

  <operator function="HardwoodBrdf90DegreeReflBOF" name="brdf_90_degree_refl">
    <map_interface source="hardwood_finish"     destination="finish"/>
  </operator>

  <operator function="HardwoodGlossinessBOF" name="glossiness">
    <map_interface source="hardwood_finish"     destination="finish"/>
  </operator>

  <operator function="RoundCornerRadiusSpiderBOF" name="round_corner_radius_BOF">
    <map_interface source="hardwood_roundcorners_on"     destination="round_corners_on"/>
    <map_interface source="hardwood_roundcorners_radius" destination="round_corners_radius"/>
  </operator>
  
  <operator function="HardwoodGenericDiffuseBOF" name="generic_diffuse_BOF">
    <map_interface source="hardwood_tint_enabled"     destination="tint_enabled"/>
    <map_interface source="hardwood_tint_color"     destination="tint_color"/>
  </operator>
  
  <operator function="HardwoodGenericDiffuseImageFadeBOF" name="diffuse_image_fade_BOF">
    <map_interface source="hardwood_tint_enabled"     destination="tint_enabled"/>
  </operator>

  <bindings target="shader" name="root">
    <map_constant  source="hardwood_color_by_object"                destination="color_by_object"/>
    <map_interface source="hardwood_color"                          destination="generic_diffuse"/>
    <map_operator  source="generic_diffuse_BOF"                     destination="generic_diffuse"/>
    <map_operator  source="diffuse_image_fade_BOF"                  destination="generic_diffuse_image_fade"/>
    <map_operator  source="brdf_0_degree_refl"                      destination="generic_reflectivity_at_0deg"/>
    <map_operator  source="brdf_90_degree_refl"                     destination="generic_reflectivity_at_90deg"/>
    <map_operator  source="glossiness"                              destination="generic_glossiness"/>
    <map_constant  source="hardwood_is_metal"                       destination="generic_is_metal"/>
    <map_constant  source="hardwood_transparency"                   destination="generic_transparency"/>
    <map_constant  source="hardwood_transparency_image_fade"        destination="generic_transparency_image_fade"/>
    <map_constant  source="hardwood_refraction_index"               destination="generic_refraction_index"/>
    <map_constant  source="hardwood_refraction_translucency_weight" destination="generic_refraction_translucency_weight"/>
    <map_constant  source="hardwood_cutout_opacity"                 destination="generic_cutout_opacity"/>
    <map_constant  source="hardwood_backface_cull"                  destination="generic_backface_cull"/>
    <map_constant  source="hardwood_self_illum_luminance"           destination="generic_self_illum_luminance"/>
    <map_constant  source="hardwood_self_illum_color_temperature"   destination="generic_self_illum_color_temperature"/>
    <map_interface source="hardwood_imperfections_amount"           destination="generic_bump_amount"/>
    <map_bindings  source="bump_map_asset"                          destination="generic_bump_map"/>
    <map_interface source="reflection_glossy_samples"               destination="generic_reflection_glossy_samples"/>
    <map_constant  source="hardwood_refraction_glossy_samples"      destination="generic_refraction_glossy_samples"/>
    <map_interface source="hardwood_ao_on"                          destination="generic_ao_on"/>
    <map_interface source="hardwood_ao_samples"                     destination="generic_ao_samples"/>
    <map_interface source="hardwood_ao_distance"                    destination="generic_ao_distance"/>
    <map_interface source="hardwood_ao_details"                     destination="generic_ao_details"/>
    <map_bindings  source="round_corner_radius_map"                 destination="generic_roundcorners_radius"/>
    <map_operator  source="round_corner_radius_BOF"                 destination="generic_roundcorners_radius"/>
    <map_interface source="hardwood_roundcorners_allow_different_materials" destination="generic_roundcorners_allow_different_materials"/>
    <map_interface source="hardwood_refl_depth"                     destination="generic_refl_depth"/>
    <map_interface source="common_Tint_toggle"                     destination="common_Tint_toggle"/>
    <map_interface source="common_Tint_color"                      destination="common_Tint_color"/>  
  </bindings>

  <!--  Defines the connected assets for "generic_bump_map" property.  -->
  <operator function="HardwoodBumpMapBOF" name="bump_map">
    <map_interface  source="hardwood_imperfections"           destination="imperfections"/>
  </operator>

  <bindings target="bump_map_asset_instance" name="bump_map_asset">    
    <map_operator  source="bump_map"                          destination="property_name"/>
  </bindings>

  <!-- Basically, when the XXX_roundcorners_on is true, we should map the value or connected asset of xxxx_rouncornders_radius to generic_roundcorners_radius. Or set generic_roundcorners_radius to 0.0 -->
  <operator function="RoundCornersRadiusMapSpiderBOF" name="round_corner_radius_map_property_name">
    <map_interface source="hardwood_roundcorners_on"     destination="round_corners_on"/>
    <map_interface source="hardwood_roundcorners_radius" destination="round_corners_radius"/>
  </operator>

  <bindings target="round_corner_radius_map" name="round_corner_radius_map">
    <map_operator source="round_corner_radius_map_property_name" destination="property_name" />
  </bindings>
  
</implementation>
