Duplicate materials - what do I draw?

This maybe a completely stupid question to ask but it is now puzzling me as to how to render or choose the correct material to draw in Collada 1.4.1 if more than one material is listed in the instance geometry.

A colleague designed a village on Google Sketchup for me and I have been trying to view it in our own bespoke viewer. From the geometry library there appears to be 2 sets of triangles to be be rendered with different materials. On closer inspection it turns out the triangles in each set overlap each other 100%. Tracing back to the instance geomtry we see the two materials ‘bound in’ to the geometry:-[attachment=2:3p7hgo3o]instancegeometryPNG.PNG[/attachment:3p7hgo3o]

Using the Collada viewer from the Mac we get this bitmap :-[attachment=1:3p7hgo3o]mac_preview_version.png[/attachment:3p7hgo3o]
Which is correct.

Unfortunately by choosing the first material from the list of 2 I get:-[attachment=0:3p7hgo3o]IMG_0038.PNG[/attachment:3p7hgo3o]
Please note the missing materials. I chose the first one listed in the set as the material to use. If I chose the other material, then the missing roofs would be drawn but the materials on the current ones would not be drawn.

Best wishes
Gordon Pagan

In COLLADA, geometry primitives request a material using a symbolic name. In the instance declaration, the actual materials are bound. This is explained on pdf page 320 of the 1.5 spec.

Your software must match of the material attribute values in the mesh with the instance material symbol attributes, then resolve the associated target attribute to the actual material. In your example there must be some mesh primitives with e.g.

  <triangles material="Material1">
  <triangles material="Material2">