Explorar o código

Fixed newline error. Resized table columns.

mitm %!s(int64=5) %!d(string=hai) anos
pai
achega
8fd6045c9d
Modificáronse 1 ficheiros con 12 adicións e 12 borrados
  1. 12 12
      src/docs/asciidoc/jme3/advanced/texture_atlas.adoc

+ 12 - 12
src/docs/asciidoc/jme3/advanced/texture_atlas.adoc

@@ -1,7 +1,5 @@
 = Optimization: Texture Atlas
-:author: 
-:revnumber: 
-:revdate: 2016/03/17 20:48
+:revnumber: 1.1
 :relfileprefix: ../../
 :imagesdir: ../..
 ifdef::env-github,env-browser[:outfilesuffix: .adoc]
@@ -11,8 +9,9 @@ The `jme3tools.optimize.TextureAtlas` allows combining multiple textures into on
 
 `jme3tools.optimize.GeometryBatchFactory`, in contrast, only works if the geometries have only one material with textures.
 
-.  Create a TextureAtlas. 
-.  Add textures to texture atlas, each texture goes onto one map (e.g. `DiffuseMap`). +The image data is stored in a byte array for each named texture map. 
+.  Create a TextureAtlas.
+.  Add textures to texture atlas, each texture goes onto one map (e.g. `DiffuseMap`). +
+  The image data is stored in a byte array for each named texture map.
 .  Later, you retrieve each map by name as a Texture, and use it in materials.
 
 
@@ -22,7 +21,7 @@ The `jme3tools.optimize.TextureAtlas` allows combining multiple textures into on
 
 
 == API
-[cols="2", options="header"]
+[cols="40,60", options="header"]
 |===
 
 a|TextureAtlas method
@@ -50,7 +49,8 @@ a|getAtlasTexture(mapName)
 a|Creates a new atlas texture from the added textures for the given map name.
 
 |===
-[cols="2", options="header"]
+
+[cols="40,60", options="header"]
 |===
 
 a|TextureAtlasTile method
@@ -78,9 +78,9 @@ The helper methods that work with Geometry objects automatically consider the `D
 *  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.
+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. 
+*  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). ??
 
@@ -117,9 +117,9 @@ Create a texture atlas and change the texture coordinates of one geometry:
  // Either auto-create texture Atlas from an existing node that has geometries...
  TextureAtlas atlas = TextureAtlas.createAtlas(scene);
 
- //... or create Atlas manually by adding textures (e.g. myDiffuseTexture) to the atlas, 
+ //... or create Atlas manually by adding textures (e.g. myDiffuseTexture) to the atlas,
  TextureAtlas atlas = new TextureAtlas(1024,1024);
- atlas.addTexture(myDiffuseTexture, "DiffuseMap"); 
+ atlas.addTexture(myDiffuseTexture, "DiffuseMap");
 
  // ... or create Atlas manually by adding textured geometries (e.g. myGeometry) to the atlas:
  TextureAtlas atlas = new TextureAtlas(1024,1024);
@@ -129,7 +129,7 @@ Create a texture atlas and change the texture coordinates of one geometry:
  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 
+ // 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);