Procházet zdrojové kódy

Update how_to_use_materials.adoc

Fixed first 2 tables continuation.
mitm001 před 9 roky
rodič
revize
09059e5dc8

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

@@ -81,21 +81,24 @@ Every Material must have at least Material Colors or Textures. Some optional mat
 To give an unshaded material a color:
 
 .  Specify the color property 
++
 [source,java]
 ----
 mat.setColor("Color", ColorRGBA.Blue); // with Unshaded.j3md
 ----
-
++
 
 To give an Phong-illuminated material a color:
 
 .  Activate material colors: 
++
 [source,java]
 ----
 mat.setBoolean("UseMaterialColors",true); // with Lighting.j3md
 ----
-
++
 .  Specify at least Diffuse and Ambient colors. Set both to the same color in the standard case. 
++
 [source,java]
 ----
 mat.setColor("Diffuse", ColorRGBA.Blue ); // with Lighting.j3md
@@ -148,12 +151,14 @@ A NormalMap (also called BumpMap) is an extra colored texture that describes the
 To add a BumpMap (this only makes sense for illuminated Materials):
 
 .  Generate normal vectors information for the Mesh (not for the Geometry!) using `com.jme3.util.TangentBinormalGenerator`. 
++
 [source,java]
 ----
 TangentBinormalGenerator.generate(mesh);
 ----
 
 .  Specify the `NormalMap` texture for the Material. 
++
 [source,java]
 ----
 mat.setTexture("NormalMap", assetManager.loadTexture("Textures/wood_normal.png")); // with Lighting.j3md
@@ -169,12 +174,14 @@ To activate Shininess (this only makes sense for illuminated Materials):
 
 .  Specify the `Shininess` intensity the Material. +
 Shininess is a float value between 1 (rough surface with blurry shininess) and 128 (very smooth surface with focused shininess)
++
 [source,java]
 ----
 mat.setFloat("Shininess", 5f);
 ----
 
 .  Activate material colors: 
++
 [source,java]
 ----
 mat.setBoolean("UseMaterialColors",true);
@@ -182,6 +189,7 @@ mat.setBoolean("UseMaterialColors",true);
 
 .  Specify the `Specular` and `Diffuse` colors of the shiny spot. +
 Typically you set Specular to the ColorRGBA value of the light source, often RGBA.White.
++
 [source,java]
 ----
 mat.setColor("Specular",ColorRGBA.White);
@@ -190,6 +198,7 @@ mat.setColor("Diffuse",ColorRGBA.White);
 
 .  (Optional) Specify a `SpecularMap` texture. +
 You optionally hand-draw this grayscale texture to outline in detail where the surface should be more shiny (whiter grays) and where less (blacker grays). If you don't supply a SpecularMap, the whole material is shiny everywhere. 
++
 [source,java]
 ----
 mat.setTexture("SpecularMap", assetManager.loadTexture("Textures/metal_spec.png")); // with Lighting.j3md
@@ -211,6 +220,7 @@ mat.setColor("Specular",ColorRGBA.Black);
 To activate glow:
 
 .  Add one <<jme3/advanced/bloom_and_glow#,BloomFilter PostProcessor>> in your simpleInitApp() method (only once, it is used by all glowing objects).
++
 [source,java]
 ----
 FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
@@ -221,6 +231,7 @@ viewPort.addProcessor(fpp);
 
 .  Specify a `Glow` color. +
 A ColorRGBA value of your choice, e.g. choose a warm or cold color for different effects, or white for a neutral glow.
++
 [source,java]
 ----
 mat.setColor("GlowColor",ColorRGBA.White);
@@ -228,6 +239,7 @@ mat.setColor("GlowColor",ColorRGBA.White);
 
 .  (Optional) Specify a `GlowMap` texture. +
 This texture outlines in detail where the DiffuseMap texture glows. If you don't supply a GlowMap, the whole material glows everwhere.  
++
 [source,java]
 ----
 mat.setTexture("GlowMap", assetManager.loadTexture("Textures/alien_glow.png"));
@@ -284,19 +296,18 @@ mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
 
 .  Put the Geometry (not the Material!) in the appropriate render queue bucket. +
 Objects in the translucent bucket (e.g. particles) are not affected by SceneProcessors (e.g. shadows). Objects in the transparent bucket (e.g. foliage) are affected by SceneProcessors (e.g. shadows).
-**  
+**
 [source,java]
 ----
 geo.setQueueBucket(Bucket.Translucent); 
 ----
 
-**  
+**
 [source,java]
 ----
 geo.setQueueBucket(Bucket.Transparent); 
 ----
 
-
 .  (Optional) Specify other material settings.
 
 [cols="3", options="header"]