<html>
  <head>
    <meta name="viewport" content="width=device-width">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    The more modern approach would be texture-arrays which might
    outperform texture atlas implementation in terms of implementation
    effort and memory bandwidth. It requires all textures to be of the
    same dimensions.<br>
    I'm successfully using this for texture variation on terrain and
    vegetation. Unfortunately you'll have to use the shader pipeline and
    write your own visitor to map the different textures to the
    instances of your geometry by adding an uniform to them or using an
    attribute (which might be a bit better performance-wise as there are
    no state-changes)<br>
    <br>
    Cheers <br>
    Sebastian<br>
    --<br>
    <br>
    <div class="gmail_quote"><br>
      <br>
      Trajce Nikolov NICK <<a href="http://trajce.nikolov.nick">trajce.nikolov.nick</a>@gmail.com>schrieb:
      <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex;
        border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
        <div> Hi Aaron,
          <div> <br>
          </div>
          <div> I would do this with texture atlas - all roofs in one
            large texture and map them separately. This is sort of
            common in database development </div>
        </div>
        <div class="gmail_extra"> <br>
          <div class="gmail_quote"> On Sat, Aug 29, 2015 at 11:14 PM,
            Aaron Andersen<span> <<a href="mailto:aaron@fosslib.net"
                target="_blank">aaron@fosslib.net</a>></span> wrote:<br>
            <blockquote class="gmail_quote" style="margin: 0 0 0
              0.8ex;border-left: 1.0px rgb(204,204,204)
              solid;padding-left: 1.0ex;"> Hello,<br>
              <br>
              Consider if I have a mesh file constructed from 2
              geometries: a cube, and a pyramid on top of the cube,
              representing a simple house. When I load this house it is
              pulled into OSG as a single Geode composed of 2 Geometry
              instances.<br>
              <br>
              I have 2 image files for this house: a brown brick house
              texture and a black shingle texture which can be applied
              to the 2 geometries of the house mesh. Now consider if I
              have 2 more textures: a dark grey vinyl siding texture,
              and a dark green metal roof texture. If I keep producing
              more image files you can imagine all the different
              possibilities I might have in constructing a home.<br>
              <br>
              Now consider if I want to make a row of 25 houses:<br>
              <br>
              osg::Group * rootOfScene = new osg::Group;<br>
              <br>
              osg::Node * houseGeode =
              osgDB::readNodeFile("house-mesh.ext");<br>
              <br>
              for (int i = 0; i < 25; i++)<br>
              {<br>
                  osg::PositionAttitudeTransform * transform = new
              osg::PositionAttitudeTransform;<br>
              <br>
                  transform->setPosition(osg::Vec3d(i * 20.f, 0, 0));<br>
                  transform->addChild(houseGeode);<br>
              <br>
                  rootOfScene->addChild(transform);<br>
              }<br>
              <br>
              What is the most efficient way to apply these different
              texture sets so that I can have a row of houses, each with
              different textures being applied to the cube mesh and the
              pyramid mesh?<br>
              <br>
              Any help is greatly appreciated.<br>
              <br>
              Thank you,<br>
              Aaron<br>
              _______________________________________________<br>
              osg-users mailing list<br>
              <a href="mailto:osg-users@lists.openscenegraph.org"
                target="_blank">osg-users@lists.openscenegraph.org</a><br>
              <a
href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org"
                target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div> <br>
          </div>
          --<br>
          <div class="gmail_signature"> trajce nikolov nick<br>
          </div>
        </div>
        _______________________________________________ osg-users
        mailing list <a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><a
href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org"
          target="_blank">
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
      </blockquote>
    </div>
  </body>
</html>