Results 1 to 3 of 3

Thread: Several material references for one geometry

  1. #1
    Junior Member
    Join Date
    Mar 2006

    Several material references for one geometry

    Hi all,

    Just a question,

    I importe the geometry in a DirectX Application, and I'm working on the meterial import.
    In the XSD schéma, there is a "bind_material" node in the "instance_geometry" node. And in the definition of mesh triangles, the is also a reference to a material in a attribute of the "triangles" node...

    I have exported an object from 3DS Max, and I have a reference to the material in the triangles node, so when the "bind_material" node in the "instance_geometry" node is used?



  2. #2
    Senior Member
    Join Date
    Jan 2006
    Foster City, CA
    The <bind_material> is always used to bind the materials specified in the geometry element (via the "material" attribute of a geometric primitive like <triangles>) to actual <material> elements.

    When I export a box from max I get a material="_1_-_Default" specified on the <triangles> element. That name gets looked up in the <bind_material> to find the actual material element that maps to. Inside the <bind_material> I have <instance_material symbol="_1_-_Default" target="#_1_-_Default">. You find the symbol attribute that matches the name you're looking for ("_1_-_Default") and then the target attribute gives you the ID of the actual <material> element to bind the geometry to. Now in this case (and probably in your case too) the name attached to the <triangles> element (aka the material "symbol") matches exactly the actual material element's ID. This is just a coincidence... Max does it this way in this particular case but another tool can have different names for the symbol and the target, e.g.
    <triangles material="myMaterial">
    <instance_material symbol="myMaterial" target="_1_-_Default">

    It's done this way in order to allow instancing of the geometry where each instance has a different material.

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Thank you very much, I understood

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts