anchor.diff:  = Optimization: Texture Atlas
  -:author: 
  -:revnumber: 
  -:revdate: 2016/03/17 20:48
  +:revnumber: 1.1
   :relfileprefix: ../../
   :imagesdir: ../..
   ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  
positive.code: *  The first map name that you supply becomes the *master map*. The master map defines locations on the atlas. Typically, you name the master map `DiffuseMap` (for Lighting.j3md) or `ColorMap` (for Unshaded.j3md). +In general, if you want to use the texture with a certain shader, you should supply the map names that are specified in this shader's .j3md for clarity.
  *  Secondary textures (other map names, for example `SpecularMap` and `NormalMap` for Lighting.j3md) have to reference a existing texture on the master map, so the Atlas knows where to position the added texture on the secondary map. This is necessary because the maps share texture coordinates and thus need to be placed at the same location on both maps. If you do not share texture coordinates in your maps, use separate TextureAtlas classes.
  
  You reference textures by their *asset key name*, this is what their “id is. For each texture, the atlas stores its location. A texture with an existing key name is never added more than once to the atlas. You can access the information for each texture or geometry texture via helper methods.
  
  *  Textures are not scaled automatically, and your atlas needs to be created large enough to hold all textures. All methods that allow adding textures return false if the texture could not be added due to the atlas being full. 
  *  Secondary textures (normal maps, specular maps etc.) have to be the same size as the main (e.g. DiffuseMap) texture.
  *  The TextureAtlas lets you change the texture coordinates of a mesh or geometry to point at the new locations of its texture inside the atlas (if the texture exists inside the atlas). ??
  
  
negative.code:  Material mat = new Material(mgr, "Common/MatDefs/Light/Lighting.j3md");
   mat.setTexture("DiffuseMap", atlas.getAtlasTexture("DiffuseMap"));
  
   // Get one sub-geometry on which you want to use the Atlas, apply texture coordinates
   // of this geometry to the atlas, and replace the material.
   Geometry geom = scene.getChild("MyGeometry");
   atlas.applyCoords(geom);
  