<shader compiler="xmlshader" name="splatting_base">
  <technique priority="200">
    <pass>
      <mixmode><copy/></mixmode>
      <buffer source="normal" destination="normal" />
      <vp plugin="glarb" file="/shader/splatting_base.avp"/>
      <texture destination="unit 0" name="standardtex normalization map" />
      <texture destination="unit 1" name="standardtex normalization map" />
      <texture destination="unit 2" name="tex diffuse" />
      <texture destination="unit 3" name="standardtex normalization map" />
      <fp plugin="glfixed">
        <fixedfp>
	  <layer>
	    <colorsource num="0" source="texture" modifier="color"/>
	    <coloroperation operation="replace"/>
          </layer>
          <layer>
            <colorsource num="0" source="previous layer" modifier="color"/>
            <colorsource num="1" source="texture" modifier="color"/>
            <coloroperation operation="dot3"/>
          </layer>
          <layer>
            <colorsource num="0" source="previous layer" modifier="color"/>
            <colorsource num="1" source="texture" modifier="color"/>
            <coloroperation operation="modulate"/>
          </layer>
          <layer>
            <colorsource num="0" source="previous layer" modifier="color"/>
	    <colorsource num="1" source="primary color" modifier="color"/>
            <coloroperation operation="modulate"/>
          </layer>
        </fixedfp>
      </fp>
    </pass>
  </technique>

  <technique priority="100">
    <pass>
      <mixmode><copy/></mixmode>
      <buffer source="normal" destination="normal" />
      <vp plugin="glarb" file="/shader/flat_ppl_diffuse_a.avp"/>
      <texture destination="unit 0" name="standardtex normalization map" />
      <texture destination="unit 1" name="standardtex normalization map" />
      <fp plugin="glfixed">
        <fixedfp>
	  <layer>
	    <colorsource num="0" source="texture" modifier="color"/>
	    <coloroperation operation="replace"/>
          </layer>
          <layer>
            <colorsource num="0" source="previous layer" modifier="color"/>
            <colorsource num="1" source="texture" modifier="color"/>
            <coloroperation operation="dot3"/>
          </layer>
        </fixedfp>
      </fp>
    </pass>
    <pass>
      <mixmode><multiply/></mixmode>
      <buffer source="normal" destination="normal" />
      <vp plugin="glarb" file="/shader/splatting_base_b.avp"/>
      <texture destination="unit 0" name="tex diffuse" />
      <fp plugin="glfixed">
        <fixedfp>
          <layer>
            <colorsource num="0" source="texture" modifier="color"/>
	    <colorsource num="1" source="primary color" modifier="color"/>
            <coloroperation operation="modulate"/>
          </layer>
        </fixedfp>
      </fp>
    </pass>
  </technique>

  <technique priority="50">
    <pass>
      <mixmode><copy/></mixmode>
      <buffer source="normal" destination="normal" />
      <vp plugin="glfixed" file="/shader/vertexlight.fvp"/>
      <texture destination="unit 0" name="tex diffuse" />
      <fp plugin="glfixed">
        <fixedfp>
          <layer>
            <colorsource num="0" source="primary color" modifier="color"/>
            <colorsource num="1" source="texture" modifier="color"/>
            <coloroperation operation="modulate"/>
          </layer>
        </fixedfp>
      </fp>
    </pass>
  </technique>

  <technique priority="0">
    <pass>
      <mixmode><copy/></mixmode>
      <buffer source="normal" destination="normal" />
      <vp plugin="software" />
      <fp plugin="software" />
    </pass>
  </technique>

</shader>
