Explorar el Código

Update how_to_use_materials.adoc

Fixed broken tip.
mitm001 hace 9 años
padre
commit
2d19efafc5
Se han modificado 1 ficheros con 5 adiciones y 19 borrados
  1. 5 19
      src/docs/asciidoc/jme3/intermediate/how_to_use_materials.adoc

+ 5 - 19
src/docs/asciidoc/jme3/intermediate/how_to_use_materials.adoc

@@ -22,10 +22,10 @@ You want to make the most of your 3D models by specifying good looking material
 Don't forget to add a <<jme3/advanced/light_and_shadow#,Light Source>> to the scene! All Materials (except “Unshaded ones) are *invisible* without a light source.
 Don't forget to add a <<jme3/advanced/light_and_shadow#,Light Source>> to the scene! All Materials (except “Unshaded ones) are *invisible* without a light source.
 ====
 ====
 
 
-
 If you want more advanced background info: You can learn more about <<jme3/advanced/material_definitions#,Material Definitions>> in general here. You can find the full list of Material Parameters in the <<jme3/advanced/materials_overview#,Material Definitions Properties>> overview. The following sections introduce you to the most commonly used cases. You typically initialize Material objects in the `simpleInitApp()` method, and configure them using the setters described here. Then load the Materials using `myGeometry.setMaterial(mat)`. 
 If you want more advanced background info: You can learn more about <<jme3/advanced/material_definitions#,Material Definitions>> in general here. You can find the full list of Material Parameters in the <<jme3/advanced/materials_overview#,Material Definitions Properties>> overview. The following sections introduce you to the most commonly used cases. You typically initialize Material objects in the `simpleInitApp()` method, and configure them using the setters described here. Then load the Materials using `myGeometry.setMaterial(mat)`. 
 
 
 
 
+
 == Code Sample
 == Code Sample
 
 
 The following samples assume that you loaded a Geometry called myGeometry, and want to assign a material to it.
 The following samples assume that you loaded a Geometry called myGeometry, and want to assign a material to it.
@@ -39,7 +39,6 @@ Material mat = new Material(assetManager,  // Create new material and...
     "Common/MatDefs/Misc/Unshaded.j3md");  // ... specify .j3md file to use (unshaded).
     "Common/MatDefs/Misc/Unshaded.j3md");  // ... specify .j3md file to use (unshaded).
 mat.setColor("Color", ColorRGBA.Blue);     // Set some parameters, e.g. blue.
 mat.setColor("Color", ColorRGBA.Blue);     // Set some parameters, e.g. blue.
 myGeometry.setMaterial(mat);               // Use new material on this Geometry.
 myGeometry.setMaterial(mat);               // Use new material on this Geometry.
-
 ----
 ----
 
 
 This example creates a link:http://en.wikipedia.org/wiki/Phong_reflection_model[Phong]-illuminated blue material. Use it for illuminated, naturalistic objects, such as characters, buildings, terrains, vehicles. Needs a light source, otherwise it will be invisible.
 This example creates a link:http://en.wikipedia.org/wiki/Phong_reflection_model[Phong]-illuminated blue material. Use it for illuminated, naturalistic objects, such as characters, buildings, terrains, vehicles. Needs a light source, otherwise it will be invisible.
@@ -53,10 +52,8 @@ mat.setBoolean("UseMaterialColors",true);  // Set some parameters, e.g. blue.
 mat.setColor("Ambient", ColorRGBA.Blue);   // ... color of this object
 mat.setColor("Ambient", ColorRGBA.Blue);   // ... color of this object
 mat.setColor("Diffuse", ColorRGBA.Blue);   // ... color of light being reflected
 mat.setColor("Diffuse", ColorRGBA.Blue);   // ... color of light being reflected
 myGeometry.setMaterial(mat);               // Use new material on this Geometry.
 myGeometry.setMaterial(mat);               // Use new material on this Geometry.
-
 ----
 ----
 
 
-
 [TIP]
 [TIP]
 ====
 ====
 Do you reuse Materials? You can <<sdk/material_editing#,store Material properties in a .j3m file>> and load all properties in one line using 
 Do you reuse Materials? You can <<sdk/material_editing#,store Material properties in a .j3m file>> and load all properties in one line using 
@@ -65,8 +62,6 @@ Do you reuse Materials? You can <<sdk/material_editing#,store Material propertie
 ----
 ----
 myGeometry.setMaterial( assetManager.loadMaterial("Materials/myMaterial.j3m"));
 myGeometry.setMaterial( assetManager.loadMaterial("Materials/myMaterial.j3m"));
 ----
 ----
-
-
 ====
 ====
 
 
 
 
@@ -76,6 +71,7 @@ myGeometry.setMaterial( assetManager.loadMaterial("Materials/myMaterial.j3m"));
 Every Material must have at least Material Colors or Textures. Some optional material features also require a combination of both. 
 Every Material must have at least Material Colors or Textures. Some optional material features also require a combination of both. 
 
 
 
 
+
 === Colored
 === Colored
 
 
 To give an unshaded material a color:
 To give an unshaded material a color:
@@ -117,7 +113,6 @@ To give an unshaded material a texture:
 mat.setTexture("ColorMap", assetManager.loadTexture("Textures/monkey.png")); // with Unshaded.j3md
 mat.setTexture("ColorMap", assetManager.loadTexture("Textures/monkey.png")); // with Unshaded.j3md
 ----
 ----
 
 
-
 To give a Phong-illuminated material a texture:
 To give a Phong-illuminated material a texture:
 
 
 *  Specify at least the DiffuseMap texture: 
 *  Specify at least the DiffuseMap texture: 
@@ -127,8 +122,6 @@ To give a Phong-illuminated material a texture:
 mat.setTexture("DiffuseMap", assetManager.loadTexture("Textures/wood_diffuse.png")); // with Lighting.j3md
 mat.setTexture("DiffuseMap", assetManager.loadTexture("Textures/wood_diffuse.png")); // with Lighting.j3md
 ----
 ----
 
 
-
-
 [TIP]
 [TIP]
 ====
 ====
 It can happen that you load textures at different scales, for example, your blades of grass may look as big as twigs, or your spaceship's heat tiles may look like small bathroom tiles. Then you need to adjust the texture scale, either bigger (> 1.0f) or smaller (< 1.0f). 
 It can happen that you load textures at different scales, for example, your blades of grass may look as big as twigs, or your spaceship's heat tiles may look like small bathroom tiles. Then you need to adjust the texture scale, either bigger (> 1.0f) or smaller (< 1.0f). 
@@ -137,14 +130,12 @@ It can happen that you load textures at different scales, for example, your blad
 ----
 ----
 geometry.scaleTextureCoordinates(new Vector2f(0.5f, 0.5f));
 geometry.scaleTextureCoordinates(new Vector2f(0.5f, 0.5f));
 ----
 ----
-
- 
 ====
 ====
 
 
-
 All other Texture Maps or Material settings are optional. If used skillfully, they make your model look really spiffy.
 All other Texture Maps or Material settings are optional. If used skillfully, they make your model look really spiffy.
 
 
 
 
+
 == (Optional) Bumpy
 == (Optional) Bumpy
 
 
 A NormalMap (also called BumpMap) is an extra colored texture that describes the fine bumpy details of the Material surface. E.g. fine cracks, pores, creases, notches. Using a BumpMap is more efficient than trying to shape the mesh to be bumpy.
 A NormalMap (also called BumpMap) is an extra colored texture that describes the fine bumpy details of the Material surface. E.g. fine cracks, pores, creases, notches. Using a BumpMap is more efficient than trying to shape the mesh to be bumpy.
@@ -165,7 +156,6 @@ TangentBinormalGenerator.generate(mesh);
 mat.setTexture("NormalMap", assetManager.loadTexture("Textures/wood_normal.png")); // with Lighting.j3md
 mat.setTexture("NormalMap", assetManager.loadTexture("Textures/wood_normal.png")); // with Lighting.j3md
 ----
 ----
 
 
-
 link:http://en.wikipedia.org/wiki/Bump_mapping[Learn more about creating and using NormalMaps and BumpMaps here.]
 link:http://en.wikipedia.org/wiki/Bump_mapping[Learn more about creating and using NormalMaps and BumpMaps here.]
 
 
 
 
@@ -205,7 +195,6 @@ You optionally hand-draw this grayscale texture to outline in detail where the s
 mat.setTexture("SpecularMap", assetManager.loadTexture("Textures/metal_spec.png")); // with Lighting.j3md
 mat.setTexture("SpecularMap", assetManager.loadTexture("Textures/metal_spec.png")); // with Lighting.j3md
 ----
 ----
 
 
-
 To deactivate shininess
 To deactivate shininess
 
 
 *  Set the `Specular` color to `ColorRGBA.Black`. Do not just set `Shininess` to 0.
 *  Set the `Specular` color to `ColorRGBA.Black`. Do not just set `Shininess` to 0.
@@ -247,7 +236,6 @@ This texture outlines in detail where the DiffuseMap texture glows. If you don't
 mat.setTexture("GlowMap", assetManager.loadTexture("Textures/alien_glow.png"));
 mat.setTexture("GlowMap", assetManager.loadTexture("Textures/alien_glow.png"));
 ----
 ----
 
 
-
 To deactivate glow:
 To deactivate glow:
 
 
 *  Set the `Glow` color to `ColorRGBA.Black`.
 *  Set the `Glow` color to `ColorRGBA.Black`.
@@ -257,10 +245,10 @@ To deactivate glow:
 mat.setColor("GlowColor", ColorRGBA.Black);
 mat.setColor("GlowColor", ColorRGBA.Black);
 ----
 ----
 
 
-
 Learn more about <<jme3/advanced/bloom_and_glow#,Bloom and Glow>>.
 Learn more about <<jme3/advanced/bloom_and_glow#,Bloom and Glow>>.
 
 
 
 
+
 == (Optional) Transparent
 == (Optional) Transparent
 
 
 Most Material Definitions support an alpha channel to make a model opaque, translucent, or transparent.
 Most Material Definitions support an alpha channel to make a model opaque, translucent, or transparent.
@@ -293,7 +281,6 @@ mat.setTexture("AlphaMap", assetManager.loadTexture("Textures/window_alpha.png")
 mat.setBoolean("UseAlpha",true);
 mat.setBoolean("UseAlpha",true);
 ----
 ----
 
 
-
 .  Specify BlendMode Alpha for the Material. 
 .  Specify BlendMode Alpha for the Material. 
 +
 +
 [source,java]
 [source,java]
@@ -345,7 +332,6 @@ Deactivate Alpha Testing for gradually *translucent* objects, such as colored gl
 
 
 |===
 |===
 
 
-
 [TIP]
 [TIP]
 ====
 ====
 It is possible to load a DiffuseMap texture that has an Alpha channel, and combine it with an underlying Material Color. 
 It is possible to load a DiffuseMap texture that has an Alpha channel, and combine it with an underlying Material Color. 
@@ -355,7 +341,7 @@ It is possible to load a DiffuseMap texture that has an Alpha channel, and combi
 mat.setBoolean("UseAlpha",true);
 mat.setBoolean("UseAlpha",true);
 ----
 ----
 
 
- The Material Color bleeds through the transparent areas of the top-layer DiffuseMap texture. In this case you do not need BlendMode Alpha – because it's not the whole Material that is transparent, but only one of the texture layers. You use this bleed-through effect, for example, to generate differently colored uniforms, animals, or plants, where each Material uses the same “template DiffuseMap texture but combines it with a different color.
+The Material Color bleeds through the transparent areas of the top-layer DiffuseMap texture. In this case you do not need BlendMode Alpha – because it's not the whole Material that is transparent, but only one of the texture layers. You use this bleed-through effect, for example, to generate differently colored uniforms, animals, or plants, where each Material uses the same “template DiffuseMap texture but combines it with a different color.
 ====
 ====