Results 1 to 4 of 4

Thread: multiple <instance_material>s in <bind_material>

  1. #1
    Junior Member
    Join Date
    Jun 2006
    Posts
    11

    multiple <instance_material>s in <bind_material>

    Hi,
    how should i interpret multiple <instance_material>s in <bind_material> when instancing geometry? Is it a multipass effect or what?

    And as i learned from the collada scheme it is possible to have multiple <instance_xxx> under the single <node>, am i correct to assume that in practice only one instance(camera or geo or controller) is present under the same node? In other words there is only one instance per node.

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    how should i interpret multiple <instance_material>s in <bind_material> when instancing geometry? Is it a multipass effect or what?
    No, <instance_material> is used to bind the material symbol of a primitive like <triangles> to a <material> element. Multiple <instance_material>s allow you to bind multiple material symbols to multiple <material> elements. For example, I might have this setup:
    Code :
    <mesh>
        <triangles material="material1">...</triangles>
        <triangles material="material2">...</triangles>
    </mesh>
    ...
    <instance_geometry>
        <bind_material>
            <technique_common>
                <instance_material symbol="material1" target="#myMaterial1"/>
                <instance_material symbol="material2" target="#myMaterial2"/>
    am i correct to assume that in practice only one instance(camera or geo or controller) is present under the same node? In other words there is only one instance per node.
    No, you can have multiple instances per node, including multiple instances of the same type.

    Steve

  3. #3
    Junior Member
    Join Date
    Jun 2006
    Posts
    11
    Thanks for reply, i got it about material, but how should i instance several geometries(or cameras or..) under the same node(and consequentally same transform) in my scene graph? My scenegraph node can store only one instance + it`s transform, but with multiply instances in collada it seems i must store a list of objects under the same node or have the transformation as the separate node (like in maya).

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    You could change your scene graph structure to support multiple instances per node, or you could make multiple nodes, one for each instance_geometry (or instance_whatever). For example, if you nave a Collada node N1 which instantiates geometries G1 and G2, you could add a new node in your scene graph N2 as a sibling of N1 which instantiates G2.

    It's not surprising that you might need to rework the scene graph somewhat to conform to your engine's capabilities, just as you have to rework the materials or any other data.

    Steve

Posting Permissions

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