|
@@ -1,6 +1,6 @@
|
|
|
= Material Definition Properties
|
|
|
-:author:
|
|
|
-:revnumber:
|
|
|
+:author:
|
|
|
+:revnumber:
|
|
|
:revdate: 2016/03/17 20:48
|
|
|
:keywords: material, texture, MatDefs, light, culling, RenderStates, documentation
|
|
|
:relfileprefix: ../../
|
|
@@ -10,7 +10,7 @@ ifdef::env-github,env-browser[:outfilesuffix: .adoc]
|
|
|
|
|
|
In jMonkeyEngine 3, colors and textures are represented as Material objects.
|
|
|
|
|
|
-* All Geometries must have Materials. To improve performance, reuse Materials for similar models, don't create a new Material object for every Geometry. (E.g. use one bark Material for several tree models.)
|
|
|
+* All Geometries must have Materials. To improve performance, reuse Materials for similar models, don't create a new Material object for every Geometry. (E.g. use one bark Material for several tree models.)
|
|
|
* Each Material is based on one of jme3's default Material Definitions (.j3md files) that are included in the engine. Advanced users can create additional custom Material Definitions (see how it's done in the <<jme3/build_from_sources#,jme3 sources>>).
|
|
|
|
|
|
|
|
@@ -24,7 +24,7 @@ Or find more background info on <<jme3/advanced/material_definitions#,How to use
|
|
|
|
|
|
== All Materials Definition Properties
|
|
|
|
|
|
-The following Materials table shows you the Material Definitions that jMonkeyEngine 3 supports.
|
|
|
+The following Materials table shows you the Material Definitions that jMonkeyEngine 3 supports.
|
|
|
|
|
|
|
|
|
[TIP]
|
|
@@ -32,7 +32,7 @@ The following Materials table shows you the Material Definitions that jMonkeyEng
|
|
|
Looks confusing? +
|
|
|
1) Start learning about `Unshaded.j3md` and `Lighting.j3md`, they cover 90% of the cases. +
|
|
|
2) Use <<sdk/material_editing#,the SDK's visual material editor>> to try out and save material settings easily. +
|
|
|
-3) The <<sdk/code_editor#,SDK's Palette>> contains drag&drop code snippets for loading materials.
|
|
|
+3) The <<sdk/code_editor#,SDK's Palette>> contains drag&drop code snippets for loading materials.
|
|
|
====
|
|
|
|
|
|
|
|
@@ -44,68 +44,68 @@ Most Material parameters are optional. For example, it is okay to specify solely
|
|
|
jMonkeyEngine supports illuminated and unshaded Material Definitions.
|
|
|
|
|
|
* Phong Illuminated materials look more naturalistic.
|
|
|
-* Unshaded materials look more abstract.
|
|
|
+* Unshaded materials look more abstract.
|
|
|
|
|
|
-“Unshaded materials look somewhat abstract because they ignore lighting and shading. Unshaded Materials work even if the scene does not include a light source. These Materials can be single-colored or textured. For example, they are used for cards and tiles, for the sky, billboards and UI elements, for toon-style games, or for testing.
|
|
|
+"`Unshaded`" materials look somewhat abstract because they ignore lighting and shading. Unshaded Materials work even if the scene does not include a light source. These Materials can be single-colored or textured. For example, they are used for cards and tiles, for the sky, billboards and UI elements, for toon-style games, or for testing.
|
|
|
|
|
|
-[cols="20,40,40", options="header"]
|
|
|
+[cols="20,35,45", options="header"]
|
|
|
.Standard Unshaded
|
|
|
|===
|
|
|
|
|
|
-a| Material Definition
|
|
|
-a| Usage
|
|
|
-<a| Material Parameters
|
|
|
+a| Material Definition
|
|
|
+a| Usage
|
|
|
+<a| Material Parameters
|
|
|
|
|
|
a| Common/MatDefs/Misc/ +
|
|
|
-Unshaded.j3md
|
|
|
+Unshaded.j3md
|
|
|
a| Standard, non-illuminated Materials. +
|
|
|
Use this for simple coloring and texturing, glow, and transparency. +
|
|
|
-See also: <<jme3/beginner/hello_material#,Hello Material>>
|
|
|
+See also: <<jme3/beginner/hello_material#,Hello Material>>
|
|
|
a| *Texture Maps* +
|
|
|
-setTexture(“ColorMap, assetManager.loadTexture(“)); +
|
|
|
-setBoolean(“SeparateTexCoord,true); +
|
|
|
-setTexture(“LightMap, assetManager.loadTexture(“)); +
|
|
|
+setTexture("`ColorMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setBoolean("`SeparateTexCoord`",true); +
|
|
|
+setTexture("`LightMap`", assetManager.loadTexture("`name`")); +
|
|
|
*Colors* +
|
|
|
-setColor(“Color, ColorRGBA.White); +
|
|
|
-setBoolean(“VertexColor,true); +
|
|
|
+setColor("`Color`", ColorRGBA.White); +
|
|
|
+setBoolean("`VertexColor`",true); +
|
|
|
*Glow* +
|
|
|
-setTexture(“GlowMap, assetManager.loadTexture(“)); +
|
|
|
-setColor(“GlowColor, ColorRGBA.White);
|
|
|
+setTexture("`GlowMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setColor("`GlowColor`", ColorRGBA.White);
|
|
|
|
|
|
|===
|
|
|
|
|
|
Other useful, but less commonly used material definitions:
|
|
|
|
|
|
-[cols="20,40,40", options="header"]
|
|
|
+[cols="20,35,45", options="header"]
|
|
|
.Special Unshaded
|
|
|
|===
|
|
|
|
|
|
-a| Material Definition
|
|
|
-a| Usage
|
|
|
-<a| Material Parameters
|
|
|
+a| Material Definition
|
|
|
+a| Usage
|
|
|
+<a| Material Parameters
|
|
|
|
|
|
<a| Common/MatDefs/Misc/ +
|
|
|
-Sky.j3md
|
|
|
+Sky.j3md
|
|
|
a| A solid skyblue, or use with a custom SkyDome texture. +
|
|
|
-See also: <<jme3/advanced/sky#,Sky>>
|
|
|
-a| setTexture(“TextureCubeMap, assetManager.loadTexture(“)); +
|
|
|
-setBoolean(“SphereMap,true); +
|
|
|
-setVector3(“NormalScale, new Vector3f(0,0,0));
|
|
|
+See also: <<jme3/advanced/sky#,Sky>>
|
|
|
+a| setTexture("`TextureCubeMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setBoolean("`SphereMap`",true); +
|
|
|
+setVector3("`NormalScale`", new Vector3f(0,0,0));
|
|
|
|
|
|
a| Common/MatDefs/Terrain/ +
|
|
|
-Terrain.j3md
|
|
|
+Terrain.j3md
|
|
|
a| Splat textures for e.g. terrains. +
|
|
|
-See also: <<jme3/beginner/hello_terrain#,Hello Terrain>>
|
|
|
-a| setTexture(“Tex1, assetManager.loadTexture(“)); +
|
|
|
+See also: <<jme3/beginner/hello_terrain#,Hello Terrain>>
|
|
|
+a| setTexture("`Tex1`", assetManager.loadTexture("`name`")); +
|
|
|
(red) +
|
|
|
-setFloat(“Tex1Scale,1f); +
|
|
|
-setTexture(“Tex2, assetManager.loadTexture(“)); +
|
|
|
+setFloat("`Tex1Scale`",1f); +
|
|
|
+setTexture("`Tex2`", assetManager.loadTexture("`name`")); +
|
|
|
(green) +
|
|
|
-setFloat(“Tex2Scale,1f); +
|
|
|
-setTexture(“Tex3, assetManager.loadTexture(“)); +
|
|
|
+setFloat("`Tex2Scale`",1f); +
|
|
|
+setTexture("`Tex3`", assetManager.loadTexture("`name`")); +
|
|
|
(blue) +
|
|
|
-setFloat(“Tex3Scale,1f); +
|
|
|
-setTexture(“Alpha, assetManager.loadTexture(“));
|
|
|
+setFloat("`Tex3Scale`",1f); +
|
|
|
+setTexture("`Alpha`", assetManager.loadTexture("`name`"));
|
|
|
|
|
|
a|Common/MatDefs/Terrain/ +
|
|
|
HeightBasedTerrain.j3md
|
|
@@ -119,30 +119,30 @@ For example: Specify a seafloor texture for the lowest areas, +
|
|
|
a sandy texture for the beaches, +
|
|
|
a grassy texure for inland areas, +
|
|
|
and a rocky texture for mountain tops.
|
|
|
-a| setFloat(“terrainSize,512f); +
|
|
|
-setTexture(“region1ColorMap, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“region2ColorMap, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“region3ColorMap, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“region4ColorMap, assetManager.loadTexture(“)); +
|
|
|
-setVector3(“region1, new Vector3f(0,0,0)); +
|
|
|
-setVector3(“region2, new Vector3f(0,0,0)); +
|
|
|
-setVector3(“region3, new Vector3f(0,0,0)); +
|
|
|
-setVector3(“region4, new Vector3f(0,0,0)); +
|
|
|
+a| setFloat("`terrainSize`",512f); +
|
|
|
+setTexture("`region1ColorMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`region2ColorMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`region3ColorMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`region4ColorMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setVector3("`region1`", new Vector3f(0,0,0)); +
|
|
|
+setVector3("`region2`", new Vector3f(0,0,0)); +
|
|
|
+setVector3("`region3`", new Vector3f(0,0,0)); +
|
|
|
+setVector3("`region4`", new Vector3f(0,0,0)); +
|
|
|
*Settings for steep areas:* +
|
|
|
-setTexture(“slopeColorMap, assetManager.loadTexture(“)); +
|
|
|
-setFloat(“slopeTileFactor,1f);
|
|
|
+setTexture("`slopeColorMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setFloat("`slopeTileFactor`",1f);
|
|
|
|
|
|
<a| Common/MatDefs/Misc/ +
|
|
|
-Particle.j3md
|
|
|
+Particle.j3md
|
|
|
a| Used with texture masks for particle effects, or for point sprites. +
|
|
|
The Quadratic value scales the particle for perspective view (link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/effect/ParticleEmitter.java[formula]). +
|
|
|
Does support an optional colored glow effect. +
|
|
|
-See also: <<jme3/beginner/hello_effects#,Hello Effects>>
|
|
|
-a| setTexture(“Texture, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“GlowMap, assetManager.loadTexture(“)); +
|
|
|
-setColor(“GlowColor, ColorRGBA.White); +
|
|
|
-setFloat(“Quadratic,1f); +
|
|
|
-setBoolean(“PointSprite,true);
|
|
|
+See also: <<jme3/beginner/hello_effects#,Hello Effects>>
|
|
|
+a| setTexture("`Texture`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`GlowMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setColor("`GlowColor`", ColorRGBA.White); +
|
|
|
+setFloat("`Quadratic`",1f); +
|
|
|
+setBoolean("`PointSprite`",true);
|
|
|
|
|
|
|===
|
|
|
|
|
@@ -154,50 +154,50 @@ jMonkeyEngine supports illuminated and unshaded Material Definitions.
|
|
|
* Phong Illuminated materials look more naturalistic.
|
|
|
* Unshaded materials look more abstract.
|
|
|
|
|
|
-Illuminated materials require a <<jme3/advanced/light_and_shadow#,light source>> added to at least one of their parent nodes! (e.g. rootNode.) Illuminated materials are darker on the sides facing away from light sources. They use Phong illumination model (default), or the Ward isotropic gaussian specular shader (WardIso) which looks more like plastic. They do not cast <<jme3/advanced/light_and_shadow#,drop shadows>> unless you use a FilterPostProcessor.
|
|
|
+Illuminated materials require a <<jme3/advanced/light_and_shadow#,light source>> added to at least one of their parent nodes! (e.g. rootNode.) Illuminated materials are darker on the sides facing away from light sources. They use Phong illumination model (default), or the Ward isotropic gaussian specular shader (WardIso) which looks more like plastic. They do not cast <<jme3/advanced/light_and_shadow#,drop shadows>> unless you use a FilterPostProcessor.
|
|
|
|
|
|
-[cols="20,40,40", options="header"]
|
|
|
+[cols="20,35,45", options="header"]
|
|
|
.Standard Illuminated
|
|
|
|===
|
|
|
|
|
|
-a|Material Definition
|
|
|
-a| Usage
|
|
|
-a| Material Parameters
|
|
|
+a|Material Definition
|
|
|
+a| Usage
|
|
|
+a| Material Parameters
|
|
|
|
|
|
<a| Common/MatDefs/Light/ +
|
|
|
-Lighting.j3md
|
|
|
+Lighting.j3md
|
|
|
a| Commonly used Material with Phong illumination. +
|
|
|
Use this material together with DiffuseMap, SpecularMap, BumpMap (NormalMaps, ParalaxMap) textures. +
|
|
|
Supports shininess, transparency, and plain material colors (Diffuse, Ambient, Specular colors). +
|
|
|
-See also: <<jme3/beginner/hello_material#,Hello Material>>
|
|
|
+See also: <<jme3/beginner/hello_material#,Hello Material>>
|
|
|
<a| *Texture Maps* +
|
|
|
-setTexture(“DiffuseMap, assetManager.loadTexture(“)); +
|
|
|
-setBoolean(“UseAlpha,true); footnote:[UseAlpha specifies whether DiffuseMap uses the alpha channel] +
|
|
|
-setTexture(“NormalMap, assetManager.loadTexture(“)); +
|
|
|
-setBoolean(“LATC,true); footnote:[LATC Specifies whether NormalMap is BC5/ATI2n/LATC/3Dc-compressed] +
|
|
|
-setTexture(“SpecularMap, assetManager.loadTexture(“)); +
|
|
|
-setFloat(“Shininess,64f); +
|
|
|
-setTexture(“ParallaxMap, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“AlphaMap, assetManager.loadTexture(“)); +
|
|
|
-setFloat(“AlphaDiscardThreshold,1f); +
|
|
|
-setTexture(“ColorRamp, assetManager.loadTexture(“)); +
|
|
|
+setTexture("`DiffuseMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setBoolean("`UseAlpha`",true); footnote:[UseAlpha specifies whether DiffuseMap uses the alpha channel] +
|
|
|
+setTexture("`NormalMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setBoolean("`LATC`",true); footnote:[LATC Specifies whether NormalMap is BC5/ATI2n/LATC/3Dc-compressed] +
|
|
|
+setTexture("`SpecularMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setFloat("`Shininess`",64f); +
|
|
|
+setTexture("`ParallaxMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`AlphaMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setFloat("`AlphaDiscardThreshold`",1f); +
|
|
|
+setTexture("`ColorRamp`", assetManager.loadTexture("`name`")); +
|
|
|
*Glow* +
|
|
|
-setTexture(“GlowMap, assetManager.loadTexture(“)); +
|
|
|
-setColor(“GlowColor, ColorRGBA.White); +
|
|
|
+setTexture("`GlowMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setColor("`GlowColor`", ColorRGBA.White); +
|
|
|
*Performance and quality* +
|
|
|
-setBoolean(“VertexLighting,true); +
|
|
|
-setBoolean(“UseVertexColor,true); +
|
|
|
-setBoolean(“LowQuality,true); +
|
|
|
-setBoolean(“HighQuality,true); +
|
|
|
+setBoolean("`VertexLighting`",true); +
|
|
|
+setBoolean("`UseVertexColor`",true); +
|
|
|
+setBoolean("`LowQuality`",true); +
|
|
|
+setBoolean("`HighQuality`",true); +
|
|
|
*Material Colors* +
|
|
|
-setBoolean(“UseMaterialColors,true); +
|
|
|
-setColor(“Diffuse, ColorRGBA.White); +
|
|
|
-setColor(“Ambient, ColorRGBA.White); +
|
|
|
-setColor(“Specular, ColorRGBA.White); +
|
|
|
+setBoolean("`UseMaterialColors`",true); +
|
|
|
+setColor("`Diffuse`", ColorRGBA.White); +
|
|
|
+setColor("`Ambient`", ColorRGBA.White); +
|
|
|
+setColor("`Specular`", ColorRGBA.White); +
|
|
|
*Tangent shading:* +
|
|
|
-setBoolean(“VTangent,true); +
|
|
|
-setBoolean(“Minnaert,true); footnote:[Minnaert is a shader type.] +
|
|
|
-setBoolean(“WardIso,true); footnote:[WardIso is a shader type.]
|
|
|
+setBoolean("`VTangent`",true); +
|
|
|
+setBoolean("`Minnaert`",true); footnote:[Minnaert is a shader type.] +
|
|
|
+setBoolean("`WardIso`",true); footnote:[WardIso is a shader type.]
|
|
|
|
|
|
|===
|
|
|
|
|
@@ -205,9 +205,9 @@ setBoolean(“WardIso,true); footnote:[WardIso is a shader type.]
|
|
|
.Special Illuminated
|
|
|
|===
|
|
|
|
|
|
-a|Material Definitions
|
|
|
-a| Usage
|
|
|
-a| Material Parameters
|
|
|
+a|Material Definitions
|
|
|
+a| Usage
|
|
|
+a| Material Parameters
|
|
|
|
|
|
a|Common/MatDefs/Terrain/ +
|
|
|
TerrainLighting.j3md
|
|
@@ -219,41 +219,41 @@ Note that diffuse and normal maps all count against that. +
|
|
|
For example, you can use a maximum of 9 diffuse textures, two of which can have normal maps; +
|
|
|
or, five textures with both diffuse and normal maps.
|
|
|
a|*Texture Splat Maps* +
|
|
|
-setTexture(“DiffuseMap, assetManager.loadTexture(“)); +
|
|
|
-setFloat(“DiffuseMap_0_scale,1f); +
|
|
|
-setTexture(“NormalMap, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“DiffuseMap_1, assetManager.loadTexture(“)); +
|
|
|
-setFloat(“DiffuseMap_1_scale,1f); +
|
|
|
-setTexture(“NormalMap_1, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“DiffuseMap_2, assetManager.loadTexture(“)); +
|
|
|
-setFloat(“DiffuseMap_2_scale,1f); +
|
|
|
-setTexture(“NormalMap_2, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“DiffuseMap_3, assetManager.loadTexture(“)); +
|
|
|
-setFloat(“DiffuseMap_3_scale,1f); +
|
|
|
-setTexture(“NormalMap_3, assetManager.loadTexture(“)); +
|
|
|
+setTexture("`DiffuseMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setFloat("`DiffuseMap_0_scale`",1f); +
|
|
|
+setTexture("`NormalMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`DiffuseMap_1`", assetManager.loadTexture("`name`")); +
|
|
|
+setFloat("`DiffuseMap_1_scale`",1f); +
|
|
|
+setTexture("`NormalMap_1`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`DiffuseMap_2`", assetManager.loadTexture("`name`")); +
|
|
|
+setFloat("`DiffuseMap_2_scale`",1f); +
|
|
|
+setTexture("`NormalMap_2`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`DiffuseMap_3`", assetManager.loadTexture("`name`")); +
|
|
|
+setFloat("`DiffuseMap_3_scale`",1f); +
|
|
|
+setTexture("`NormalMap_3`", assetManager.loadTexture("`name`")); +
|
|
|
etc, up to 11. +
|
|
|
*Alpha Maps* +
|
|
|
-setTexture(“AlphaMap, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“AlphaMap_1, assetManager.loadTexture(“)); +
|
|
|
-setTexture(“AlphaMap_2, assetManager.loadTexture(“)); +
|
|
|
+setTexture("`AlphaMap`", assetManager.loadTexture("name")); +
|
|
|
+setTexture("`AlphaMap_1`", assetManager.loadTexture("`name`")); +
|
|
|
+setTexture("`AlphaMap_2`", assetManager.loadTexture("`name`")); +
|
|
|
*Glowing* +
|
|
|
-setTexture(“GlowMap, assetManager.loadTexture(“)); +
|
|
|
-setColor(“GlowColor, ColorRGBA.White); +
|
|
|
+setTexture("`GlowMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setColor("`GlowColor`", ColorRGBA.White); +
|
|
|
*Miscellaneous* +
|
|
|
-setColor(“Diffuse, ColorRGBA.White); +
|
|
|
-setColor(“Ambient, ColorRGBA.White); +
|
|
|
-setFloat(“Shininess,64f); +
|
|
|
-setColor(“Specular, ColorRGBA.White); +
|
|
|
-setTexture(“SpecularMap, assetManager.loadTexture(“)); +
|
|
|
-setBoolean(“WardIso,true); +
|
|
|
-setBoolean(“useTriPlanarMapping,true); +
|
|
|
-setBoolean(“isTerrainGrid,true);
|
|
|
+setColor("`Diffuse`", ColorRGBA.White); +
|
|
|
+setColor("`Ambient`", ColorRGBA.White); +
|
|
|
+setFloat("`Shininess`",64f); +
|
|
|
+setColor("`Specular`", ColorRGBA.White); +
|
|
|
+setTexture("`SpecularMap`", assetManager.loadTexture("`name`")); +
|
|
|
+setBoolean("`WardIso`",true); +
|
|
|
+setBoolean("`useTriPlanarMapping`",true); +
|
|
|
+setBoolean("`isTerrainGrid`",true);
|
|
|
|
|
|
<a| Common/MatDefs/Light/ +
|
|
|
-Reflection.j3md
|
|
|
-a| Reflective glass material with environment map (CubeMap/SphereMap). See also: link:http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java[TestCubeMap.java]
|
|
|
-a| setTexture(“Texture, assetManager.loadTexture(“)); +
|
|
|
-setBoolean(“SphereMap,true);
|
|
|
+Reflection.j3md
|
|
|
+a| Reflective glass material with environment map (CubeMap/SphereMap). See also: link:http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java[TestCubeMap.java]
|
|
|
+a| setTexture("`Texture`", assetManager.loadTexture("`name`")); +
|
|
|
+setBoolean("`SphereMap`",true);
|
|
|
|
|
|
|===
|
|
|
|
|
@@ -264,12 +264,12 @@ setBoolean(“SphereMap,true);
|
|
|
.Testing
|
|
|
|===
|
|
|
|
|
|
-<a| Material Definition
|
|
|
-a| Usage
|
|
|
+<a| Material Definition
|
|
|
+a| Usage
|
|
|
|
|
|
<a| Common/MatDefs/Misc/ +
|
|
|
-ShowNormals.j3md
|
|
|
-a| A color gradient calculated from the model's surface normals. You can use this built-in material to debug the generation of normals in meshes, to preview models that have no material and no lights, or as fall-back default material. This built-in material has no parameters.
|
|
|
+ShowNormals.j3md
|
|
|
+a| A color gradient calculated from the model's surface normals. You can use this built-in material to debug the generation of normals in meshes, to preview models that have no material and no lights, or as fall-back default material. This built-in material has no parameters.
|
|
|
|
|
|
|===
|
|
|
|
|
@@ -293,7 +293,7 @@ a|Use for all opaque objects like walls, floors, people…
|
|
|
a|getAdditionalRenderState() +
|
|
|
.setBlendMode(BlendMode.Alpha);
|
|
|
a|Interpolates the background pixel with the current pixel by using the current pixel's alpha.
|
|
|
-a|Use this for normal every-day translucency: Frosted window panes, ice, glass, alpha-blended vegetation textures…
|
|
|
+a|Use this for normal every-day translucency: Frosted window panes, ice, glass, alpha-blended vegetation textures…
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
.setDepthWrite(false);
|
|
@@ -304,20 +304,20 @@ a|getAdditionalRenderState() +
|
|
|
.setAlphaFallOff(0.5f); +
|
|
|
getAdditionalRenderState() +
|
|
|
.setAlphaTest(true)
|
|
|
-a|Enables Alpha Testing with a “AlphaDiscardThreshold in the AlphaMap.
|
|
|
+a|Enables Alpha Testing with a "`AlphaDiscardThreshold`" in the AlphaMap.
|
|
|
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|getAdditionalRenderState() +
|
|
|
.setBlendMode(BlendMode.Additive);
|
|
|
a|Additive alpha blending adds colors in a commutative way, i.e. the result does not depend on the order of transparent layers, since it adds the scene's background pixel color to the current pixel color. This is useful if you have lots of transparent textures overlapping and don't care about the order. +
|
|
|
-*Note:* Viewed in front of a white background, Additive textures become fully transparent!
|
|
|
-a| This is the default for Particle.j3md-based textures that have a black color background.
|
|
|
+*Note:* Viewed in front of a white background, Additive textures become fully transparent!
|
|
|
+a| This is the default for Particle.j3md-based textures that have a black color background.
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
.setBlendMode(BlendMode.AlphaAdditive);
|
|
|
-a|Same as “Additive, except first it multiplies the current pixel color by the pixel alpha.
|
|
|
-a|This can be used for particle effects that have alpha as background.
|
|
|
+a|Same as "`Additive`", except first it multiplies the current pixel color by the pixel alpha.
|
|
|
+a|This can be used for particle effects that have alpha as background.
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
.setBlendMode(BlendMode.Color);
|
|
@@ -331,12 +331,12 @@ a|?
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
.setBlendMode(BlendMode.ModulateX2);
|
|
|
-a|Same as “Modulate, except the result is doubled.
|
|
|
+a|Same as "`Modulate`", except the result is doubled.
|
|
|
a|?
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
.setBlendMode(BlendMode.PremultAlpha);
|
|
|
-a|Pre-multiplied alpha blending. E.g. if the color of the object has already been multiplied by its alpha, this is used instead of “Alpha blend mode.
|
|
|
+a|Pre-multiplied alpha blending. E.g. if the color of the object has already been multiplied by its alpha, this is used instead of "`Alpha`" blend mode.
|
|
|
a|For use with Premult Alpha textures.
|
|
|
|
|
|
|===
|
|
@@ -370,17 +370,17 @@ a|Usage
|
|
|
a|Example
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
-.setFaceCullMode(FaceCullMode.Back);
|
|
|
-a|Activates back-face culling. Mesh faces that are facing away from the camera are not rendered, which saves time. *Backface culling is activated by default as a major optimization.*
|
|
|
-a|The invisible backsides and insides of models are not calculated.
|
|
|
+.setFaceCullMode(FaceCullMode.Back);
|
|
|
+a|Activates back-face culling. Mesh faces that are facing away from the camera are not rendered, which saves time. *Backface culling is activated by default as a major optimization.*
|
|
|
+a|The invisible backsides and insides of models are not calculated.
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
-.setFaceCullMode(FaceCullMode.Off);
|
|
|
+.setFaceCullMode(FaceCullMode.Off);
|
|
|
a|No meshes are culled. Both mesh faces are rendered, even if they face away from the camera. Slow.
|
|
|
a|Sometimes used to debug custom meshes if you messed up some of the polygon sides, or for special shadow effects.
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
-.setFaceCullMode(FaceCullMode.Front);
|
|
|
+.setFaceCullMode(FaceCullMode.Front);
|
|
|
a|Activates front-face culling. Mesh faces facing the camera are not rendered.
|
|
|
a|No example – Typically not used because you wouldn't see anything meaningful.
|
|
|
|
|
@@ -403,11 +403,11 @@ a|Example
|
|
|
a|getAdditionalRenderState() +
|
|
|
.setColorWrite(false);
|
|
|
a|Disable writing the color of pixels.
|
|
|
-a|Use this together with setDepthWrite(true) to write pixels only to the depth buffer, for example.
|
|
|
+a|Use this together with setDepthWrite(true) to write pixels only to the depth buffer, for example.
|
|
|
|
|
|
a|getAdditionalRenderState() +
|
|
|
.setPointSprite(true);
|
|
|
-a|Enables point-sprite mode, e.g. meshes with “Mode.Points will be rendered as textured sprites. Note that gl_PointCoord must be set in the shader.
|
|
|
+a|Enables point-sprite mode, e.g. meshes with "`Mode`".Points will be rendered as textured sprites. Note that gl_PointCoord must be set in the shader.
|
|
|
a|Point sprites are used internally for hardware accelerated particle effects.
|
|
|
|
|
|
a|getAdditionalRenderState() +
|