Parcourir la source

Update how_to_use_materials.adoc

Fixed broken table #1.
Fixed broken new lines.
Corrected tip from < to > for scale above 1.0f.
mitm001 il y a 9 ans
Parent
commit
f3313667d9
1 fichiers modifiés avec 20 ajouts et 10 suppressions
  1. 20 10
      src/docs/asciidoc/jme3/intermediate/how_to_use_materials.adoc

+ 20 - 10
src/docs/asciidoc/jme3/intermediate/how_to_use_materials.adoc

@@ -11,7 +11,8 @@ ifdef::env-github,env-browser[:outfilesuffix: .adoc]
 A Geometry (mesh) is just the shape of the object. jMonkeyEngine cannot render a shape without knowing anything about its surface properties. You need to apply a color or texture to the surface of your Geometries to make them visible. In jMonkeyEngine, colors and textures are represented as Material objects. (An alternative would also be to load a model that includes materials generated by a mesh editor, such as Blender.)
 A Geometry (mesh) is just the shape of the object. jMonkeyEngine cannot render a shape without knowing anything about its surface properties. You need to apply a color or texture to the surface of your Geometries to make them visible. In jMonkeyEngine, colors and textures are represented as Material objects. (An alternative would also be to load a model that includes materials generated by a mesh editor, such as Blender.)
 
 
 *  All Geometries must have Materials that defines color or texture.
 *  All Geometries must have Materials that defines color or texture.
-*  Each Material is based on a Material Definition file. +Examples of included Material Definitions: Lighting.j3md, Unshaded.j3md
+*  Each Material is based on a Material Definition file. +
+Examples of included Material Definitions: Lighting.j3md, Unshaded.j3md
 
 
 You want to make the most of your 3D models by specifying good looking material parameters. The developers must be in contact with the graphic designers regarding which of the <<jme3/advanced/materials_overview#,Material properties>> they intend to use in their 3D models. You must have an understanding what <<jme3/terminology#materialstextures,texture maps>> are, to be able to use texture-mapped materials. 
 You want to make the most of your 3D models by specifying good looking material parameters. The developers must be in contact with the graphic designers regarding which of the <<jme3/advanced/materials_overview#,Material properties>> they intend to use in their 3D models. You must have an understanding what <<jme3/terminology#materialstextures,texture maps>> are, to be able to use texture-mapped materials. 
 
 
@@ -126,7 +127,7 @@ mat.setTexture("DiffuseMap", assetManager.loadTexture("Textures/wood_diffuse.png
 
 
 [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). 
 
 
 [source,java]
 [source,java]
 ----
 ----
@@ -166,7 +167,8 @@ link:http://en.wikipedia.org/wiki/Bump_mapping[Learn more about creating and usi
 
 
 To activate Shininess (this only makes sense for illuminated Materials):
 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)
+.  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]
 [source,java]
 ----
 ----
 mat.setFloat("Shininess", 5f);
 mat.setFloat("Shininess", 5f);
@@ -178,14 +180,16 @@ mat.setFloat("Shininess", 5f);
 mat.setBoolean("UseMaterialColors",true);
 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.
+.  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]
 [source,java]
 ----
 ----
 mat.setColor("Specular",ColorRGBA.White);
 mat.setColor("Specular",ColorRGBA.White);
 mat.setColor("Diffuse",ColorRGBA.White);
 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. 
+.  (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]
 [source,java]
 ----
 ----
 mat.setTexture("SpecularMap", assetManager.loadTexture("Textures/metal_spec.png")); // with Lighting.j3md
 mat.setTexture("SpecularMap", assetManager.loadTexture("Textures/metal_spec.png")); // with Lighting.j3md
@@ -215,13 +219,15 @@ fpp.addFilter(bloom);
 viewPort.addProcessor(fpp);
 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.
+.  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]
 [source,java]
 ----
 ----
 mat.setColor("GlowColor",ColorRGBA.White);
 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.  
+.  (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]
 [source,java]
 ----
 ----
 mat.setTexture("GlowMap", assetManager.loadTexture("Textures/alien_glow.png"));
 mat.setTexture("GlowMap", assetManager.loadTexture("Textures/alien_glow.png"));
@@ -276,7 +282,8 @@ mat.setBoolean("UseAlpha",true);
 mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
 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).
+.  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]
 [source,java]
 ----
 ----
@@ -291,6 +298,7 @@ geo.setQueueBucket(Bucket.Transparent);
 
 
 
 
 .  (Optional) Specify other material settings.
 .  (Optional) Specify other material settings.
+
 [cols="3", options="header"]
 [cols="3", options="header"]
 |===
 |===
 
 
@@ -310,9 +318,11 @@ a|getAdditionalRenderState().setDepthWrite(false);
 a|Disables writing of the pixel's depth value to the depth buffer.
 a|Disables writing of the pixel's depth value to the depth buffer.
 a|Deactivate this on Materials if you expect two or more transparent/translucent objects to be obscuring one another, but you want to see through both.
 a|Deactivate this on Materials if you expect two or more transparent/translucent objects to be obscuring one another, but you want to see through both.
 
 
-a|getAdditionalRenderState().setAlphaTest(true) +getAdditionalRenderState().setAlphaFallOff(0.5f);
+a|getAdditionalRenderState().setAlphaTest(true) +
+getAdditionalRenderState().setAlphaFallOff(0.5f);
 a|Enables Alpha Testing and uses an AlphaDiscardThreshold as alpha fall-off value. This means that gradients in the AlphaMap are no longer interpreted as soft translucency, but parts of the texture become either fully opaque or fully transparent. Only pixels above the alpha threshold (e.g. 0.5f) are rendered. 
 a|Enables Alpha Testing and uses an AlphaDiscardThreshold as alpha fall-off value. This means that gradients in the AlphaMap are no longer interpreted as soft translucency, but parts of the texture become either fully opaque or fully transparent. Only pixels above the alpha threshold (e.g. 0.5f) are rendered. 
-a|Activate Alpha Testing for (partially) *transparent* objects such as foliage, hair, etc. +Deactivate Alpha Testing for gradually *translucent* objects, such as colored glass, smoked glass, ghosts.
+a|Activate Alpha Testing for (partially) *transparent* objects such as foliage, hair, etc. +
+Deactivate Alpha Testing for gradually *translucent* objects, such as colored glass, smoked glass, ghosts.
 
 
 |===
 |===