- update help data

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8762 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent ad98c62321
commit fdeb66a611
  1. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/300px-surface_normal.png
  2. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/220px-trefoil_knot_arb.png
  3. 107
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/collision_and_intersection.html
  4. 76
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_meshes.html
  5. 403
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html
  6. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nurbs_3-d_surface.png
  7. 10
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics.html
  8. 43
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/shape.html
  9. 20
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/android.html
  10. 27
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html
  11. 11
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/faq.html
  12. 18
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html
  13. 103
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/terminology.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -4,45 +4,20 @@
<p>
The term collision can be used to refer to physical interactions (where physical objects collide and bump off one another), and also to non-physical intersections. This article is about non-physical (mathematical) collisions.
The term collision can be used to refer to <a href="/com/jme3/gde/core/docs/jme3/advanced/physics_listeners.html">physical interactions</a> (where <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">physical objects</a> collide, push and bump off one another), and also to non-physical <em>intersections</em> in 3D space. This article is about the non-physical (mathematical) collisions.
</p>
<p>
Non-physical collision detection is interesting because they use less computing resources than physical collision detection. You can optimize your game if you find a way to simulate a certain effect in a non-physical way, using mathematical techniques such as ray casting.
Non-physical collision detection is interesting because it uses less computing resources than physical collision detection. The non-physical calculations are faster because they do not have any side effects such as pushing other objects or bumping off of them. Tasks such as <a href="/com/jme3/gde/core/docs/jme3/advanced/mouse_picking.html">mouse picking</a> are easily implemented using using mathematical techniques such as ray casting and intersections. Experienced developers optimize their games by finding ways to simulate certain (otherwise expensive physical) interactions in a non-physical way.
</p>
<p>
One example for an optimization is a physical vehicle&#039;s wheels. You could make the wheels fully physical disks, and have jME calculate every tiny force – sounds very accurate, but is total overkill. A more performant solution is to cast four invisible rays down from the vehicle and calculate the intersections with the floor and other obstacles. These non-physical wheels require (in the simplest case) only four calculations to achieve an effect that players can hardly distinguish from the real thing.
<strong>Example:</strong> One example for an optimization is a physical vehicle&#039;s wheels. You could make the wheels fully physical disks, and have jME calculate every tiny force – sounds very accurate? It&#039;s total overkill and too slow for a racing game. A more performant solution is to cast four invisible rays down from the vehicle and calculate the intersections with the floor. These non-physical wheels require (in the simplest case) only four calculations per tick to achieve an effect that players can hardly distinguish from the real thing.
</p>
</div>
<h2><a>Bounding Volumes</a></h2>
<div>
<p>
A com.jme3.bounding.BoundingVolume is an interface for dealing with containment of a collection of points. All BoundingVolumes are Collidable and are used as optimization to calculate non-physical collisions more quickly: It&#039;s faster to calculate an intersection between simple shapes like spheres and boxes than between complex shapes. In cases where precision is not relevant, you wrap a complex model in a simpler shape to speed up collision detection.
</p>
<ul>
<li><div> Type.Sphere: com.jme3.bounding.BoundingSphere is a sphere used as a container for a group of vertices of a piece of geometry. A BoundingSphere has a center and a radius.</div>
</li>
<li><div> Type.AABB = Axis-aligned bounding box. A com.jme3.bounding.BoundingBox is an axis-aligned cuboid used as a container for a group of vertices of a piece of geometry. A BoundingBox has a center and extents from that center along the x, y and z axis.</div>
</li>
<li><div> Type.OBB = Oriented bounding box. (not in use)</div>
</li>
<li><div> Type.Capsule = Cylinder with rounded ends. Often used for mobile characters.</div>
</li>
</ul>
<p>
<strong>Note:</strong> Physical objects have their own &quot;bounding volumes&quot; called CollisionShapes.
</p>
</div>
<h2><a>Collisions</a></h2>
<h2><a>Collidable</a></h2>
<div>
<p>
@ -73,7 +48,7 @@ Note that jME counts <em>all</em> collisions, this means a ray intersecting a bo
<td>getCollision(i) </td><td>Returns the CollisionResult at index i.</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [2825-3153] -->
<!-- EDIT1 TABLE [2081-2409] -->
<p>
A CollisionResult object contains information about the second party of the collision event.
</p>
@ -100,7 +75,7 @@ A CollisionResult object contains information about the second party of the coll
<td>getTriangleIndex()</td><td>Returns the index of the triangle on the second party&#039;s mesh that was hit. (?)</td>
</tr>
</table></div>
<!-- EDIT2 TABLE [3247-3784] -->
<!-- EDIT2 TABLE [2503-3040] -->
</div>
<h3><a>Code Sample</a></h3>
@ -158,54 +133,94 @@ Knowing the distance of the collisions is useful for example when you intersect
</div>
<h2><a>Intersection</a></h2>
<h2><a>Bounding Volumes</a></h2>
<div>
<p>
A com.jme3.math.Ray is an infinite line with a beginning, a direction, and no end; whereas a com.jme3.math.Line is an infinite line with only a direction (no beginning, no end).
A com.jme3.bounding.BoundingVolume is an interface for dealing with containment of a collection of points. All BoundingVolumes are <code>Collidable</code> and are used as optimization to calculate non-physical collisions more quickly: It&#039;s always faster to calculate an intersection between simple shapes like spheres and boxes than between complex shapes like models.
</p>
<p>
Rays are used to detect where the user or a player is &quot;looking&quot; when performing an action:
All fast-paced action and shooter games use BoundingVolumes as an optimization. Wrap all complex models into simpler shapes – in the end, you get equally useful collision detection results, but faster. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Bounding_volume"><param name="text" value="<html><u>More about bounding volumes...</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
Supported types:
<img src="/wiki/lib/exe/fetch.php">
</p>
<ul>
<li><div> <strong>Click to select:</strong> You can determine what a user has clicked by casting a ray from the camera in the direction of the camera. Now identify the closest collision of the ray with the rootNode.</div>
<li><div> Type.Sphere: com.jme3.bounding.BoundingSphere is a sphere used as a container for a group of vertices of a piece of geometry. A BoundingSphere has a center and a radius.</div>
</li>
<li><div> Type.AABB = Axis-aligned bounding box, that means it doesn&#039;t rotatewhich makes it less precise. A com.jme3.bounding.BoundingBox is an axis-aligned cuboid used as a container for a group of vertices of a piece of geometry. A BoundingBox has a center and extents from that center along the x, y and z axis.</div>
</li>
<li><div> <strong>Line of sight:</strong> Cast a ray from a player in the direction of another player. Then you detect all collisions of this ray with other entities (walls, foliage, window panes) and use this to calculate whether one can see the other.</div>
<li><div> Type.OBB = Oriented bounding box. This bounding box is more precise because it can rotate with its content, but is computationally more expensive. (Currently not supported.)</div>
</li>
<li><div> Type.Capsule = Cylinder with rounded ends, also called &quot;swept sphere&quot;. Typically used for mobile characters.</div>
</li>
</ul>
<p>
These simple ray-surface intersection tests are called Ray Casting. As opposed to the more advanced Ray Tracing, Ray Casting does not follow a ray&#039;s reflection after the first hit, the ray just goes straight on.
<p><div>Note: If you are looking for BoundingVolumes for physical objects, use <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">CollisionShapes</a>.
</div></p>
</p>
</div>
<h3><a>Usage</a></h3>
<div>
<p>
Learn how to implement <a href="/com/jme3/gde/core/docs/jme3/advanced/mouse_picking.html">Mouse Picking</a> here.
For example you can use Bounding Volumes on custom meshes, or complex non-physical shapes.
</p>
<pre>mesh.setBound&#40;new BoundingSphere&#40;&#41;&#41;;
q.updateBound&#40;&#41;;</pre>
</div>
<h2><a>Bounding Interval Hierarchy</a></h2>
<h2><a>Intersection</a></h2>
<div>
<p>
com.jme3.collision.bih.BIHNode
com.jme3.scene.CollisionData
A com.jme3.math.Ray is an infinite line with a beginning, a direction, and no end; whereas a com.jme3.math.Line is an infinite line with only a direction (no beginning, no end).
</p>
</div>
<p>
Rays are used to perform line-of-sight calculations. This means you can detect what users were &quot;aiming at&quot; when they clicked or pressed a key. You can also use this to detect whether game characters can see something (or someone) or not.
</p>
<ul>
<li><div> <strong>Click to select:</strong> You can determine what a user has clicked by casting a ray from the camera forward in the direction of the camera. Now identify the closest collision of the ray with the rootNode, and you have the clicked object.</div>
</li>
<li><div> <strong>Line of sight:</strong> Cast a ray from a player in the direction of another player. Then you detect all collisions of this ray with other entities (walls versus foliage versus window panes) and use this to calculate how likely it is that one can see the other.</div>
</li>
</ul>
<h2><a>SweepSphere</a></h2>
<div>
<p>
<p><div>These simple but powerful ray-surface intersection tests are called Ray Casting. As opposed to the more advanced Ray Tracing technique, Ray Casting does not follow the ray&#039;s reflection after the first hit – the ray just goes straight on.
</div></p>
</p>
<p>
Learn the details of how to implement <a href="/com/jme3/gde/core/docs/jme3/advanced/mouse_picking.html">Mouse Picking</a> here.
</p>
<hr />
A com.jme3.collision.SweepSphere implements a collidable &quot;stretched&quot; sphere that is shaped like a capsule (an upright cylinder with half a sphere on top and the second half at the bottom).
This shape is usually used to simulate simple non-physcial collisions for character entities in games. The sweep sphere can be used to check collision against a triangle or another sweep sphere.
<p>
TODO:
</p>
<ul>
<li><div> Bounding Interval Hierarchy com.jme3.collision.bih.BIHNode</div>
</li>
<li><div> com.jme3.scene.CollisionData</div>
</li>
<li><div> A com.jme3.collision.SweepSphere implements a collidable &quot;stretched&quot; sphere that is shaped like a capsule (an upright cylinder with half a sphere on top and the second half at the bottom). This shape is usually used to simulate simple non-physcial collisions for character entities in games. The sweep sphere can be used to check collision against a triangle or another sweep sphere.</div>
</li>
</ul>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:collision_and_intersection?do=export_xhtmlbody">view online version</a></em></p>

@ -34,7 +34,14 @@ Okay, we want to create a Quad. A quad has four vertices, and is made up of two
The base class for creating meshes is <code>com.jme3.scene.Mesh</code>.
</p>
<pre>Mesh m = new Mesh&#40;&#41;;</pre>
<pre>Mesh mesh = new Mesh&#40;&#41;;</pre>
<p>
If you create your own Mesh-based class, replace <code>mesh</code> by <code>this</code> in the following examples:
</p>
<pre>public class MyMesh extends Mesh &#123; &#125;</pre>
</div>
@ -110,13 +117,13 @@ The Mesh data is stored in a buffer.
</li>
<li><div> The third parameter describes the number of components of the values. Vertex postions are 3 float values, texture coordinates are 2 float values, and the indices are single ints.</div>
</li>
<li><div> In order for JMonkey to correctly show the mesh in the scene, it needs to know the bounds of our new mesh. This can easily be achieved by calling the updateBound() method on it.</div>
<li><div> In order for jMonkey to correctly show the mesh in the scene, it needs to know the bounds of our new mesh. This can easily be achieved by calling the updateBound() method on it.</div>
</li>
</ol>
<pre>m.setBuffer&#40;Type.Position, 3, BufferUtils.createFloatBuffer&#40;vertices&#41;&#41;;
m.setBuffer&#40;Type.TexCoord, 2, BufferUtils.createFloatBuffer&#40;texCoord&#41;&#41;;
m.setBuffer&#40;Type.Index, 1, BufferUtils.createIntBuffer&#40;indexes&#41;&#41;;
m.updateBound&#40;&#41;;</pre>
<pre>mesh.setBuffer&#40;Type.Position, 3, BufferUtils.createFloatBuffer&#40;vertices&#41;&#41;;
mesh.setBuffer&#40;Type.TexCoord, 2, BufferUtils.createFloatBuffer&#40;texCoord&#41;&#41;;
mesh.setBuffer&#40;Type.Index, 1, BufferUtils.createIntBuffer&#40;indexes&#41;&#41;;
mesh.updateBound&#40;&#41;;</pre>
<p>
@ -133,11 +140,11 @@ Our Mesh is ready! Now we want to see it.
We create a <code>com.jme3.scene.Geometry</code>, apply a simple color material to it, and attach it to the rootNode to make it appear in the scene.
</p>
<pre>Geometry geom = new Geometry&#40;&quot;OurMesh&quot;, m&#41;;
Material mat = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/SolidColor.j3md&quot;&#41;;
<pre>Geometry geo = new Geometry&#40;&quot;OurMesh&quot;, mesh&#41;;
Material mat = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;;
geom.setMaterial&#40;mat&#41;;
rootNode.attachChild&#40;geom&#41;;</pre>
geo.setMaterial&#40;mat&#41;;
rootNode.attachChild&#40;geo&#41;;</pre>
<p>
@ -161,21 +168,20 @@ There are more vertex buffers in a Mesh than the three shown above. For an overv
<div>
<p>
Vertex coloring is a simple way of coloring meshes. Instead of just assigning one solid color, each vertex (corner) has a color assigned. The faces between the vertices are then colored with a gradient.
We will use the same mesh <code>m</code> as defined above, but with a special VertexColor material.
Vertex coloring is a simple way of coloring meshes. Instead of just assigning one solid color, each vertex (corner) has a color assigned. The faces between the vertices are then colored with a gradient. You can use the same mesh <code>mesh</code> object that you defined above.
</p>
<pre>Geometry coloredMesh = new Geometry &#40;&quot;ColoredMesh&quot;, m&#41;;
Material matVC = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/VertexColor.j3md&quot;&#41;;</pre>
<pre>Geometry geo = new Geometry &#40;&quot;ColoredMesh&quot;, mesh&#41;;
Material matVC = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;</pre>
<p>
We create a float array color buffer.
You create a float array color buffer:
</p>
<ul>
<li><div> We assign 4 color values, RGBA, to each vertex.</div>
<li><div> Assign 4 color values, RGBA, to each vertex.</div>
<ul>
<li><div> To loop over the 4 color values, we use a color index <pre>int colorIndex = 0;</pre>
<li><div> To loop over the 4 color values, use a color index <pre>int colorIndex = 0;</pre>
</div>
</li>
</ul>
@ -193,7 +199,7 @@ We create a float array color buffer.
</ul>
<p>
We loop over the colorArray buffer to quickly set some RGBA value for each vertex. As usual, RGBA color values range from 0.0f to 1.0f. Note that the values we use here are arbitrarily chosen! It&#039;s just a quick loop to give every vertex a different RGBA value (a purplish gray, purple, a greenish gray, green, see screenshot), without writing too much code. For your own mesh, you&#039;d assign values for the color buffer depending on which color you want your mesh to have.
Loop over the colorArray buffer to quickly set some RGBA value for each vertex. As usual, RGBA color values range from 0.0f to 1.0f. <strong>Note that the color values in this example are arbitrarily chosen.</strong> It&#039;s just a quick loop to give every vertex a different RGBA value (a purplish gray, purple, a greenish gray, green, see screenshot), without writing too much code. For your own mesh, you&#039;d assign meaningful values for the color buffer depending on which color you want your mesh to have.
</p>
<pre>for&#40;int i = 0; i &lt; 4; i++&#41;&#123;
@ -212,8 +218,8 @@ We loop over the colorArray buffer to quickly set some RGBA value for each verte
Next, set the color buffer. An RGBA color value contains four float components, thus the parameter <code>4</code>.
</p>
<pre>m.setBuffer&#40;Type.Color, 4, colorArray&#41;;
coloredMesh.setMaterial&#40;matVC&#41;;</pre>
<pre>mesh.setBuffer&#40;Type.Color, 4, colorArray&#41;;
geo.setMaterial&#40;matVC&#41;;</pre>
<p>
@ -223,6 +229,24 @@ Now you see a gradient color extending from each vertex.
</div>
<h3><a>Example: Shaded Mesh with Normals</a></h3>
<div>
<p>
The examples used the mesh together with the Unshaded.j3md material. If you want to use the Mesh with a Phong illuminated material (such as Lighting.j3md), the mesh needs to include information about its normals. (The Normals encode in which direction a mesh polygon is facing, which is important for calculating light and shadow.)
</p>
<pre>float&#91;&#93; normals = new float&#91;12&#93;;
normals = new float&#91;&#93;&#123;0,0,1, 0,0,1, 0,0,1, 0,0,1&#125;;
mesh.setBuffer&#40;Type.Normal, 3, BufferUtils.createFloatBuffer&#40;normals&#41;&#41;;</pre>
<p>
You need as many normals as the polygon has vertices. For a flat quad, they point all in the same direction. In this case, the direction is the Z unit vector (Vector3f.UNIT_Z), this means the quad is facing the camera.
</p>
</div>
<h3><a>Example: Point Mode</a></h3>
<div>
@ -232,14 +256,14 @@ Alternatively, you can show the vertices as colored points instead of coloring t
</p>
<pre>Geometry coloredMesh = new Geometry &#40;&quot;ColoredMesh&quot;, cMesh&#41;;
...
m.setMode&#40;Mesh.Mode.Points&#41;;
m.setPointSize&#40;10f&#41;;
m.updateBound&#40;&#41;;
m.setStatic&#40;&#41;;
Geometry points = new Geometry&#40;&quot;Points&quot;, m&#41;;
mesh.setMode&#40;Mesh.Mode.Points&#41;;
mesh.setPointSize&#40;10f&#41;;
mesh.updateBound&#40;&#41;;
mesh.setStatic&#40;&#41;;
Geometry points = new Geometry&#40;&quot;Points&quot;, mesh&#41;;
points.setMaterial&#40;mat&#41;;
rootNode.attachChild&#40;points&#41;;
rootNode.attachChild&#40;coloredMesh&#41;;</pre>
rootNode.attachChild&#40;geo&#41;;</pre>
<p>

@ -4,60 +4,91 @@
<p>
Geometries have Materials (.j3m), Materials are based on material definitions (.j3md). You can <a href="/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html">write .j3m files in a text editor</a>, or <a href="/com/jme3/gde/core/docs/sdk/material_editing.html">use the jMonkeyEngine SDK to generate</a> them for you.
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.
</p>
<p>
This table shows you the material definitions that jMonkeyEngine supplies by default. You want to make the most of your models by using the right material parameters. The developers should be in contact with the graphic designer regarding which of the available jMonkeyEngine features individual Materials and Textures require. You must have an understanding what <a href="/com/jme3/gde/core/docs/jme3/terminology#materialstextures.html">texture maps</a> are to be able to use textured materials.
All Geometries have Materials: You either use the setters described here to specifiy the Material&#039;s properties in your Java code, or you load a custom .j3m file that lists the properties. To improve performance, reuse Materials for similar models, don&#039;t create a new Material object for every Geometry. (E.g. use one bark Material for many tree models.)
</p>
<p>
You can <a href="/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html">write .j3m files in a text editor</a>, or <a href="/com/jme3/gde/core/docs/sdk/material_editing.html">use the jMonkeyEngine SDK to create .j3m files</a> for you. (Advanced users can also create custom Material Definitions.)
</p>
<p>
Each Material is based on one of the default material definitions (.j3md files) that are included in the engine. The Materials table shows you the material definitions that jMonkeyEngine supports by default. You want to make the most of your models by setting good looking material parameters: The developers should be in contact with the graphic designer regarding which of the available jMonkeyEngine features (listed here) are intended to be used in individual Models&#039; Materials. You must have an understanding what <a href="/com/jme3/gde/core/docs/jme3/terminology#materialstextures.html">texture maps</a> are to be able to use textured materials.
</p>
</div>
<h2><a>Usage</a></h2>
<h2><a>Code Sample</a></h2>
<div>
<p>
There are two types of material definitions below, illuminated and unshaded. Illuminated materials look more naturalistic, unshaded ones look more abstract.
The following samples assume that you loaded a Geometry, e.g. <code>Spatial myGeometry = assetManager.loadModel(&quot;Models/Teapot/Teapot.j3o&quot;);</code>
</p>
<pre>Material mat = new Material&#40;assetManager, // Create new material and
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; // specify .j3md file path.
mat.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;; // Set one or more parameters.
myGeometry.setMaterial&#40;mat&#41;; // Use material on Geometry.</pre>
<p>
Most parameters are not mandatory, even if they are not explicitly marked optional. For example, it is okay to specify solely the <code>DiffuseMap</code> and <code>NormalMap</code> when using <code>Lighting.j3md</code>, and leave the rest empty. You are only using a subset of the available features, but that&#039;s fully acceptable if it already results in the material you want. You can always add more texture maps later.
or
</p>
<pre>myGeometry.setMaterial&#40; &#40;Material&#41;assetManager.loadAsset&#40; &quot;myMaterial.j3m&quot;&#41; &#41;;</pre>
<p>
<p><div>1) Looks confusing? Start with <code>Unshaded.j3md</code>, and then <code>Lighting.j3md</code>. <br/>
Most Material parameters are not mandatory. For example, it is normal to specify solely the <code>DiffuseMap</code> and <code>NormalMap</code> when using <code>Lighting.j3md</code>, and leave the rest empty. You are only using a subset of the advanced features, but that&#039;s acceptable if it results in the material looking the way you want. You can always add more texture maps later.
</p>
<p>
<p><div>1) Looks confusing? Start with <code>Unshaded.j3md</code>, then look into <code>Lighting.j3md</code>. <br/>
2) The jMonkeyEngine <a href="/com/jme3/gde/core/docs/sdk.html">SDK</a> offers a visual editor where you can set properties and preview the outcome. The <acronym title="Software Development Kit">SDK</acronym> Palette contains code snippets to load materials. <br/>
3) If you don&#039;t know what an optional setting means, you&#039;re likely not using it.
3) If you don&#039;t know what an obscure parameter means, you&#039;re likely not using it.
</div></p>
</p>
<p>
jMonkeyEngine supports illuminated and unshaded Material Definitions.
</p>
<ul>
<li><div> Phong Illuminated materials look more naturalistic.</div>
</li>
<li><div> Unshaded materials look more abstract.</div>
</li>
</ul>
</div>
<h2><a>Standard Coloring and Textures</a></h2>
<h2><a>Unshaded Coloring and Textures</a></h2>
<div>
<p>
Standard materials look slightly abstract because they ignore light sources. They work even if the scene does not include a light source. They are single-colored or textured and have no shadows.
&quot;Unshaded&quot; 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.
</p>
<div><table>
<tr>
<th> Basic Material Definition </th><th> Usage </th><th> Parameter : Type </th>
<th> Basic Material Definition </th><th> Usage </th><th> Parameter </th>
</tr>
<tr>
<td> Common/MatDefs/Misc/Unshaded.j3md </td><td> Standard, non-illuminated Materials. Use this for simple coloring, simple texturing, simple glow, simple transparency. <br/>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a> </td><td> ColorMap : Texture <br/>
LightMap : Texture <br/>
Color : Color <br/>
VertexColor : Boolean <br/>
SeparateTexCoord : Boolean <br/>
GlowMap : Texture <br/>
GlowColor: Color </td>
<td> Common/MatDefs/Misc/Unshaded.j3md </td><td> Standard, non-illuminated Materials. <br/>
Use this for simple coloring and texturing, glow, and transparency. <br/>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a> </td><td> <strong>Texture Maps</strong> <br/>
setTexture(&quot;ColorMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setBoolean(&quot;SeparateTexCoord&quot;,true); <br/>
setTexture(&quot;LightMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
<strong>Colors</strong> <br/>
setColor(&quot;Color&quot;, ColorRGBA.White); <br/>
setBoolean(&quot;VertexColor&quot;,true); <br/>
<strong>Glow</strong> <br/>
setTexture(&quot;GlowMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setColor(&quot;GlowColor&quot;, ColorRGBA.White); </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [1907-2345] -->
<!-- EDIT1 TABLE [3394-4032] -->
<p>
Other useful, but less commonly used material definitions:
@ -65,23 +96,23 @@ Other useful, but less commonly used material definitions:
</p>
<div><table>
<tr>
<th> Special Material Definitions </th><th> Usage </th><th> Parameter : Type </th>
<th> Special Material Definitions </th><th> Usage </th><th> Setter, Parameter, Type </th>
</tr>
<tr>
<td> Common/MatDefs/Misc/Sky.j3md </td><td> A solid skyblue, or use with a custom SkyDome texture. <br/>
See also: <a href="/com/jme3/gde/core/docs/jme3/advanced/sky.html">Sky</a> </td><td> Texture : TextureCubeMap <br/>
SphereMap : Boolean <br/>
NormalScale : Vector3 </td>
See also: <a href="/com/jme3/gde/core/docs/jme3/advanced/sky.html">Sky</a> </td><td> setTexture(&quot;TextureCubeMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setBoolean(&quot;SphereMap&quot;,true); <br/>
setVector3(&quot;NormalScale&quot;, new Vector3f(0,0,0)); </td>
</tr>
<tr>
<td> Common/MatDefs/Terrain/Terrain.j3md </td><td> Splat textures for e.g. terrains. <br/>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a> </td><td> Texture1 : Texture (red) <br/>
Texture1Scale : Float <br/>
Texture2 : Texture (green) <br/>
Texture2Scale : Float <br/>
Texture3 : Texture (blue) <br/>
Texture3Scale : Float <br/>
Alpha : Texture </td>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a> </td><td> setTexture(&quot;Texture1&quot;, assetManager.loadTexture(&quot;&quot;)); (red) <br/>
setFloat(&quot;Texture1Scale&quot;,1f); <br/>
setTexture(&quot;Texture2&quot;, assetManager.loadTexture(&quot;&quot;)); (green) <br/>
setFloat(&quot;Texture2Scale&quot;,1f); <br/>
setTexture(&quot;Texture3&quot;, assetManager.loadTexture(&quot;&quot;)); (blue) <br/>
setFloat(&quot;Texture3Scale&quot;,1f); <br/>
setTexture(&quot;Alpha&quot;, assetManager.loadTexture(&quot;&quot;)); </td>
</tr>
<tr>
<td>Common/MatDefs/Terrain/HeightBasedTerrain.j3md</td><td>A multi-layered texture for terrains. <br/>
@ -93,31 +124,31 @@ Texture regions can overlap. <br/>
For example: Specify a seafloor texture for the lowest areas, <br/>
a sandy texture for the beaches, <br/>
a grassy texure for inland areas, <br/>
and a rocky texture for mountain tops.</td><td> terrainSize : Float <br/>
region1ColorMap : Texture2D <br/>
region2ColorMap : Texture2D <br/>
region3ColorMap : Texture2D <br/>
region4ColorMap : Texture2D <br/>
region1 : Vector3 <br/>
region2 : Vector3 <br/>
region3 : Vector3 <br/>
region4 : Vector3 <br/>
and a rocky texture for mountain tops.</td><td> setFloat(&quot;terrainSize&quot;,512f); <br/>
setTexture(&quot;region1ColorMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;region2ColorMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;region3ColorMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;region4ColorMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setVector3(&quot;region1&quot;, new Vector3f(0,0,0)); <br/>
setVector3(&quot;region2&quot;, new Vector3f(0,0,0)); <br/>
setVector3(&quot;region3&quot;, new Vector3f(0,0,0)); <br/>
setVector3(&quot;region4&quot;, new Vector3f(0,0,0)); <br/>
<strong>Settings for steep areas:</strong> <br/>
slopeColorMap : Texture2D <br/>
slopeTileFactor : Float</td>
setTexture(&quot;slopeColorMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setFloat(&quot;slopeTileFactor&quot;,1f);</td>
</tr>
<tr>
<td> Common/MatDefs/Misc/Particle.j3md </td><td> Used with texture masks for particle effects, or for point sprites. <br/>
The Quadratic value scales the particle for perspective view (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/effect/ParticleEmitter.java"><param name="text" value="<html><u>formula</u></html>"><param name="textColor" value="blue"></object>). <br/>
Does support an optional colored glow effect. <br/>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html">Hello Effects</a> </td><td> Texture : Texture <br/>
GlowMap : Texture <br/>
GlowColor : Color <br/>
Quadratic : Float <br/>
PointSprite : Boolean </td>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html">Hello Effects</a> </td><td> setTexture(&quot;Texture&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;GlowMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setColor(&quot;GlowColor&quot;, ColorRGBA.White); <br/>
setFloat(&quot;Quadratic&quot;,1f); <br/>
setBoolean(&quot;PointSprite&quot;,true); </td>
</tr>
</table></div>
<!-- EDIT2 TABLE [2407-4279] -->
<!-- EDIT2 TABLE [4094-6616] -->
</div>
<h2><a>Phong Illuminated</a></h2>
@ -125,50 +156,50 @@ PointSprite : Boolean </td>
<p>
Illuminated materials require a <a href="/com/jme3/gde/core/docs/jme3/advanced/light_and_shadow.html">light source</a> 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 do not automatically cast <a href="/com/jme3/gde/core/docs/jme3/advanced/light_and_shadow.html">drop shadows</a>. They use Phong illumination model (default), or the Ward isotropic gaussian specular shader (WardIso) which looks more plastic like.
Illuminated materials require a <a href="/com/jme3/gde/core/docs/jme3/advanced/light_and_shadow.html">light source</a> 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 <a href="/com/jme3/gde/core/docs/jme3/advanced/light_and_shadow.html">drop shadows</a> unless you use a FilterPostProcessor.
</p>
<div><table>
<tr>
<th>Illuminated Material Definition </th><th> Usage </th><th> Parameters </th>
<th>Illuminated Material Definition </th><th> Usage </th><th> Setter, Parameter, Type </th>
</tr>
<tr>
<td> Common/MatDefs/Light/Lighting.j3md </td><td> Standard lit material with Phong Illumination. <br/>
<td> Common/MatDefs/Light/Lighting.j3md </td><td> Commonly used Material with Phong illumination. <br/>
Use this material together with DiffuseMap, SpecularMap, BumpMap (NormalMaps, ParalaxMap) textures. <br/>
Supports shininess, transparency, and plain material colors (Diffuse, Ambient, Specular colors). <br/>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a> <br/>
Glowing materials require a <a href="/com/jme3/gde/core/docs/jme3/advanced/bloom_and_glow.html">FilterPostProcessor</a>! </td><td> DiffuseMap : Texture <br/>
UseAlpha<sup><a href="#fn__1">1)</a></sup> : Boolean <br/>
NormalMap : Texture <br/>
LATC<sup><a href="#fn__2">2)</a></sup> : Boolean <br/>
SpecularMap : Texture <br/>
Shininess : Float [1-128] <br/>
ParallaxMap : Texture <br/>
AlphaMap : Texture <br/>
AlphaDiscardThreshold: Float <br/>
ColorRamp : Texture <br/>
<strong>Glow (optional)</strong> <br/>
GlowMap : Texture <br/>
GlowColor : Color <br/>
<strong>Performance and quality (optional)</strong> <br/>
VertexLighting : Boolean <br/>
UseVertexColor : Boolean <br/>
LowQuality : Boolean <br/>
HighQuality : Boolean <br/>
<strong>Material Colors (optional)</strong> <br/>
UseMaterialColors : Boolean <br/>
Diffuse : Color <br/>
Ambient : Color <br/>
Specular : Color <br/>
<strong>Tangent shading (optional):</strong> <br/>
VTangent : Boolean <br/>
Minnaert<sup><a href="#fn__3">3)</a></sup> : Boolean <br/>
WardIso<sup><a href="#fn__4">4)</a></sup> : Boolean </td>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a> </td><td> <strong>Texture Maps</strong> <br/>
setTexture(&quot;DiffuseMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setBoolean(&quot;UseAlpha&quot;,true);<sup><a href="#fn__1">1)</a></sup> <br/>
setTexture(&quot;NormalMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setBoolean(&quot;LATC&quot;,true); <sup><a href="#fn__2">2)</a></sup> <br/>
setTexture(&quot;SpecularMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setFloat(&quot;Shininess&quot;,64f); <br/>
setTexture(&quot;ParallaxMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;AlphaMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setFloat(&quot;AlphaDiscardThreshold&quot;,1f); <br/>
setTexture(&quot;ColorRamp&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
<strong>Glow</strong> <br/>
setTexture(&quot;GlowMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setColor(&quot;GlowColor&quot;, ColorRGBA.White); <br/>
<strong>Performance and quality</strong> <br/>
setBoolean(&quot;VertexLighting&quot;,true); <br/>
setBoolean(&quot;UseVertexColor&quot;,true); <br/>
setBoolean(&quot;LowQuality&quot;,true); <br/>
setBoolean(&quot;HighQuality&quot;,true); <br/>
<strong>Material Colors</strong> <br/>
setBoolean(&quot;UseMaterialColors&quot;,true); <br/>
setColor(&quot;Diffuse&quot;, ColorRGBA.White); <br/>
setColor(&quot;Ambient&quot;, ColorRGBA.White); <br/>
setColor(&quot;Specular&quot;, ColorRGBA.White); <br/>
<strong>Tangent shading:</strong> <br/>
setBoolean(&quot;VTangent&quot;,true); <br/>
setBoolean(&quot;Minnaert&quot;,true);<sup><a href="#fn__3">3)</a></sup> <br/>
setBoolean(&quot;WardIso&quot;,true);<sup><a href="#fn__4">4)</a></sup> </td>
</tr>
</table></div>
<!-- EDIT3 TABLE [4746-6102] --><div><table>
<!-- EDIT3 TABLE [7108-8822] --><div><table>
<tr>
<th>Special Illuminated Material Definitions </th><th> Usage </th><th> Parameters </th>
<th>Special Illuminated Material Definitions </th><th> Usage </th><th> Setter, Parameter, Type </th>
</tr>
<tr>
<td>Common/MatDefs/Terrain/TerrainLighting.j3md</td><td>Same kind of multi-layered splat texture as Terrain.j3md, but with illumination and shading. <br/>
@ -177,69 +208,140 @@ For every 3 splat textures, you need one alpha map. <br/>
You can use a total of 11 texture maps in the terrain&#039;s splat texture: <br/>
Note that diffuse and normal maps all count against that. <br/>
For example, you can use a maximum of 9 diffuse textures, two of which can have normal maps; <br/>
or, five textures with both diffuse and normal maps.</td><td>Diffuse : Color <br/>
Ambient : Color <br/>
Shininess : Float <br/>
Specular : Color <br/>
SpecularMap : Texture <br/>
WardIso : Boolean <br/>
useTriPlanarMapping : Boolean <br/>
isTerrainGrid : Boolean <br/>
<strong>Texture Splat Maps</strong> <br/>
DiffuseMap : Texture <br/>
DiffuseMap_0_scale : Float <br/>
NormalMap : Texture <br/>
DiffuseMap_1 : Texture <br/>
DiffuseMap_1_scale : Float <br/>
NormalMap_1 : Texture <br/>
DiffuseMap_2 : Texture <br/>
DiffuseMap_2_scale : Float <br/>
NormalMap_2 : Texture <br/>
DiffuseMap_3 : Texture <br/>
DiffuseMap_3_scale : Float <br/>
NormalMap_3 : Texture <br/>
or, five textures with both diffuse and normal maps.</td><td><strong>Texture Splat Maps</strong> <br/>
setTexture(&quot;DiffuseMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setFloat(&quot;DiffuseMap_0_scale&quot;,1f); <br/>
setTexture(&quot;NormalMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;DiffuseMap_1&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setFloat(&quot;DiffuseMap_1_scale&quot;,1f); <br/>
setTexture(&quot;NormalMap_1&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;DiffuseMap_2&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setFloat(&quot;DiffuseMap_2_scale&quot;,1f); <br/>
setTexture(&quot;NormalMap_2&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;DiffuseMap_3&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setFloat(&quot;DiffuseMap_3_scale&quot;,1f); <br/>
setTexture(&quot;NormalMap_3&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
etc, up to 11. <br/>
<strong>Alpha Maps</strong> <br/>
AlphaMap : Texture <br/>
AlphaMap_1 : Texture <br/>
AlphaMap_2 : Texture <br/>
setTexture(&quot;AlphaMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;AlphaMap_1&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setTexture(&quot;AlphaMap_2&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
<strong>Glowing</strong> <br/>
GlowMap : Texture <br/>
GlowColor : Color </td>
setTexture(&quot;GlowMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setColor(&quot;GlowColor&quot;, ColorRGBA.White); <br/>
<strong>Miscellaneous</strong> <br/>
setColor(&quot;Diffuse&quot;, ColorRGBA.White); <br/>
setColor(&quot;Ambient&quot;, ColorRGBA.White); <br/>
setFloat(&quot;Shininess&quot;,64f); <br/>
setColor(&quot;Specular&quot;, ColorRGBA.White); <br/>
setTexture(&quot;SpecularMap&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setBoolean(&quot;WardIso&quot;,true); <br/>
setBoolean(&quot;useTriPlanarMapping&quot;,true); <br/>
setBoolean(&quot;isTerrainGrid&quot;,true); </td>
</tr>
<tr>
<td> Common/MatDefs/Light/Reflection.j3md </td><td> Reflective glass material with environment map (CubeMap/SphereMap). See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java"><param name="text" value="<html><u>TestCubeMap.java</u></html>"><param name="textColor" value="blue"></object> </td><td> setTexture(&quot;Texture&quot;, assetManager.loadTexture(&quot;&quot;)); <br/>
setBoolean(&quot;SphereMap&quot;,true); </td>
</tr>
</table></div>
<!-- EDIT4 TABLE [8824-11115] -->
</div>
<h2><a>Testing and Debugging</a></h2>
<div>
<div><table>
<tr>
<td> Common/MatDefs/Light/Reflection.j3md </td><td> Reflective glass material with environment map (CubeMap/SphereMap). See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java"><param name="text" value="<html><u>TestCubeMap.java</u></html>"><param name="textColor" value="blue"></object> </td><td> Texture : Texture <br/>
SphereMap: Boolean </td>
<th> Material Definition </th><th> Usage </th>
</tr>
<tr>
<td> Common/MatDefs/Misc/ShowNormals.j3md </td><td> A color gradient calculated from the model&#039;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, or as fall-back default material. This built-in material has no parameters. </td>
</tr>
</table></div>
<!-- EDIT4 TABLE [6104-7693] -->
<!-- EDIT5 TABLE [11152-11509] -->
</div>
<h2><a>Activate Special Features</a></h2>
<div>
</div>
<h3><a>NormalMap (Bumpiness)</a></h3>
<div>
<p>
<p><div><strong>Shininess Tip:</strong> To deactivate Shininess, do not set <code>Shininess</code> to 0, but instead set the <code>Specular</code> color to <code>ColorRGBA.Black</code>!
</div></p>
A NormalMap (alos called BumpMap) describes the fine bumpy details of the Material surface that are not part of the mesh itself. E.g. cracks, pores, creases, notches.
</p>
<ol>
<li><div> Generate normals for the Mesh (not for the Geometry!) <pre>TangentBinormalGenerator.generate&#40;mesh&#41;;</pre>
</div>
</li>
<li><div> Specify the <code>NormalMap</code> texture. (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Bump_mapping"><param name="text" value="<html><u>More about BumpMaps here.</u></html>"><param name="textColor" value="blue"></object>)</div>
</li>
</ol>
</div>
<h3><a>Specular (Shininess)</a></h3>
<div>
<p>
<p><div><strong>Bumpiness Tip:</strong> Before you can use NormalMaps, you must generate normals for the mesh (not the Geometry). <code>TangentBinormalGenerator.generate(mesh);</code>
</div></p>
To activate Shininess:
</p>
<ol>
<li><div> Specify the <code>Shininess</code> intensity. <br/>
A float value between 1 (rough surface with blurry shininess) and 128 (very smooth surface with focused shininess)</div>
</li>
<li><div> Specify a Color as <code>Specular</code> value. <br/>
The ColorRGBA value of the light source, e.g. often RGBA.White.</div>
</li>
<li><div> (Optionally for some Materials) Specify a <code>SpecularMap</code> texture. <br/>
This grayscale texture outlines in detail where the DiffuseMap texture should be shiny (white) and were not (black), instead of rendering the whole material evenly shiny.</div>
</li>
</ol>
<p>
To deactivate shininess
</p>
<ul>
<li><div> Set the <code>Specular</code> color to <code>ColorRGBA.Black</code>. Do not just set <code>Shininess</code> to 0.</div>
</li>
</ul>
</div>
<h2><a>Testing and Debugging</a></h2>
<h3><a>Glow</a></h3>
<div>
<div><table>
<tr>
<th> Material Definition </th><th> Usage </th><th> Parameters </th>
</tr>
<tr>
<td> Common/MatDefs/Misc/ShowNormals.j3md </td><td> A color gradient calculated from the model&#039;s surface normals. You can use this built-in material to test models that have no material, or as fall-back default material. </td><td></td>
</tr>
</table></div>
<!-- EDIT5 TABLE [8058-8343] -->
<p>
To activate glow:
</p>
<ol>
<li><div> Add a <a href="/com/jme3/gde/core/docs/jme3/advanced/bloom_and_glow.html">FilterPostProcessor</a> in your simpleInit() method.</div>
</li>
<li><div> Specify a Color as <code>Glow</code> value. <br/>
A ColorRGBA value of your choice, e.g. choose a warm or cold color for different effects.</div>
</li>
<li><div> (Optionally for some Materials) Specify a <code>GlowMap</code> texture. <br/>
This texture outlines in detail where the DiffuseMap texture glows, instead of making the whole material glow everwhere evenly.</div>
</li>
</ol>
<p>
To deactivate glow
</p>
<ul>
<li><div> Set the <code>Glow</code> color to <code>ColorRGBA.Black</code>.</div>
</li>
</ul>
</div>
<h2><a>Transparency</a></h2>
<h3><a>Transparency</a></h3>
<div>
<p>
@ -253,80 +355,83 @@ Additionally, you must specify a blendmode:
</p>
<div><table>
<tr>
<th>Option</th><th>Usage</th><th>Example</th>
<th>Material option</th><th>Usage</th><th>Example</th>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Off);</td><td>Opaque</td><td></td>
<td>getAdditionalRenderState().setBlendMode(BlendMode.Off);</td><td>Opaque</td><td></td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);</td><td>Use this for normal transparency. Interpolates the background pixel with the current pixel by using the current pixel&#039;s alpha.</td><td>Hair texture, window panes, ice, glass, alpha-blended vegetation textures. </td>
<td>getAdditionalRenderState().setBlendMode(BlendMode.Alpha);</td><td>Interpolates the background pixel with the current pixel by using the current pixel&#039;s alpha.</td><td>Use this for normal every-day translucency: Frosted window panes, ice, glass, alpha-blended vegetation textures… </td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setDepthWrite(false);</td><td>Use this on materials if you have several transparent objects obscuring one another. Disables writing of the pixel&#039;s depth value to the depth buffer.</td>
<td>getAdditionalRenderState().setDepthWrite(false);</td><td>Disables writing of the pixel&#039;s depth value to the depth buffer.</td><td>Use this on Materials if you have several transparent/translucent objects obscuring one another, but you want to see through both.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setAlphaFallOff(0.5f); <br/>
mat.getAdditionalRenderState().setAlphaTest(true)</td><td>Enables alpha test. Works the same way as &quot;AlphaDiscardThreshold&quot;.</td><td>Generally used for vegetation etc.</td>
<td>getAdditionalRenderState().setAlphaFallOff(0.5f); <br/>
getAdditionalRenderState().setAlphaTest(true)</td><td>Enables alpha test. Works the same way as &quot;AlphaDiscardThreshold&quot;.</td><td>Used for textures that have fully opaque pixels next to fully transparent pixels, e.g. foliage, hair, vegetation.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Additive);</td><td>Additive alpha blending adds colors in a commutative way, i.e. the result does not depend on the order of transparent layers. Adds the scene&#039;s background pixel color to the current pixel color. Note that viewed in front of a white scene, these textures become fully transparent. This is useful if you have many transparent textures overlapping.</td><td>Used for particle effect textures that have a black color background. </td>
<td>getAdditionalRenderState().setBlendMode(BlendMode.Additive);</td><td>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&#039;s background pixel color to the current pixel color. This is useful if you have lots of transparent textures overlapping and don&#039;t care about the order. <br/>
Viewed in front of a white background, Additive textures become fully transparent! </td><td>Used for particle effect textures that have a black color background. </td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);</td><td>Same as &quot;Additive&quot;, except first it multiplies the current pixel color by the pixel alpha.</td><td>Used for particle effects that have alpha as background. </td>
<td>getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);</td><td>Same as &quot;Additive&quot;, except first it multiplies the current pixel color by the pixel alpha.</td><td>Used for particle effects that have alpha as background. </td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Color);</td><td>Blends by color.</td><td>Generally useless.</td>
<td>getAdditionalRenderState().setBlendMode(BlendMode.Color);</td><td>Blends by color.</td><td>Generally useless.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Modulate);</td><td>Multiplies the background pixel by the current pixel.</td>
<td>getAdditionalRenderState().setBlendMode(BlendMode.Modulate);</td><td>Multiplies the background pixel by the current pixel.</td><td>?</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.ModulateX2);</td><td>Same as &quot;Modulate&quot;, except the result is doubled.</td>
<td>getAdditionalRenderState().setBlendMode(BlendMode.ModulateX2);</td><td>Same as &quot;Modulate&quot;, except the result is doubled.</td><td>?</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.PremultAlpha);</td><td>Pre-multiplied alpha blending. E.g. if the color of the object has already been multiplied by its alpha, this is used instead of &quot;Alpha&quot; blend mode.</td><td>For use with premult alpha textures.</td>
<td>getAdditionalRenderState().setBlendMode(BlendMode.PremultAlpha);</td><td>Pre-multiplied alpha blending. E.g. if the color of the object has already been multiplied by its alpha, this is used instead of &quot;Alpha&quot; blend mode.</td><td>For use with Premult Alpha textures.</td>
</tr>
</table></div>
<!-- EDIT6 TABLE [8698-10778] -->
<!-- EDIT6 TABLE [13546-15768] -->
<p>
Also note the AlphaDiscardThreshold value for materials based on Lighting.j3md. The renderer does not render pixels whose transparancy is below the threshold.
<p><div>For partially transparent Materials based on Lighting.j3md, consider setting the <code>AlphaDiscardThreshold</code> value. The renderer only renders pixels above your alpha threshold, and does not render pixels below the threshold. 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. You typically activate Alpha Testing for partially transparent objects such as foliage, hair, etc.
</div></p>
</p>
</div>
<h2><a>Material Options</a></h2>
<h3><a>Advanced Options</a></h3>
<div>
<div><table>
<tr>
<th>Material Option</th><th>Usage</th>
<th>Material Option</th><th>Usage</th><th>Example</th>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setWireframe(true);</td><td>Switch to showing the (textured) Material in wireframe mode</td>
<td>getAdditionalRenderState().setWireframe(true);</td><td>Switch to showing the (textured) Material in wireframe mode. For debugging or &quot;matrix/holodeck&quot; effect.</td><td></td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Back); </td><td>Activate back-face culling. Mesh faces that are not visible are not rendered, which saves time. Backface culling is activated by default as an optimization.</td>
<td>getAdditionalRenderState().setFaceCullMode(FaceCullMode.Back); </td><td>Activate back-face culling. Mesh faces that are not facing the camera are not rendered, which saves time. Backface culling is activated by default as a major optimization.</td><td>The backside of mesh polygons (and the inside of models) is invisible. </td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off); </td><td>No culling. All meshes are rendered even if they are out of view. Slow.</td>
<td>getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off); </td><td>Nothing is culled. Both mesh faces are rendered, even if they face away from the camera. Slow.</td><td>Sometimes used to debug custom meshes if you messed up some of the polygon sides, or for special shadow effects.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Front); </td><td>Activate front-face culling. Mesh faces facing the camera are not rendered. Typically not used.</td>
<td>getAdditionalRenderState().setFaceCullMode(FaceCullMode.Front); </td><td>Activate front-face culling. Mesh faces facing the camera are not rendered.</td><td>Typically not used.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack)</td><td>Activate both back- and frontface culling. Use this as an efficient way to make an object temporarily invisible. All it&#039;s other in-game properties, collision shapes, interactions, etc remain active.</td>
<td>getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack)</td><td>Cull both backfaces and frontfaces.</td><td>Use this as an efficient way to make an object temporarily invisible, while keeping all its other in-game properties (node attachment, collision shapes, interactions, etc) active.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setColorWrite(false);</td><td>Disable writing the color of pixels. Use this together with setDepthWrite(true) to write pixels only to the depth buffer, for example. </td>
<td>getAdditionalRenderState().setColorWrite(false);</td><td>Disable writing the color of pixels.</td><td>Use this together with setDepthWrite(true) to write pixels only to the depth buffer, for example. </td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setPointSprite(true);</td><td>Enables point-sprite mode, so meshes with &quot;Mode.Points&quot; will be rendered as textured sprites. Note that gl_PointCoord must be set in the shader. Point sprites are used for hardware accelerated particle effects. </td>
<td>getAdditionalRenderState().setPointSprite(true);</td><td>Enables point-sprite mode, e.g. meshes with &quot;Mode.Points&quot; will be rendered as textured sprites. Note that gl_PointCoord must be set in the shader.</td><td>Point sprites are used internally for hardware accelerated particle effects.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setPolyOffset();</td><td>Enable polygon offset. Use this when you have meshes that have triangles really close to each over (e.g. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Coplanarity"><param name="text" value="<html><u>Coplanar</u></html>"><param name="textColor" value="blue"></object>), it will shift the depth values to prevent <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Z-fighting"><param name="text" value="<html><u>Z-fighting</u></html>"><param name="textColor" value="blue"></object>.</td>
<td>getAdditionalRenderState().setPolyOffset();</td><td>Enable polygon offset.</td><td>Use this when you have meshes that have triangles really close to each over (e.g. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Coplanarity"><param name="text" value="<html><u>Coplanar</u></html>"><param name="textColor" value="blue"></object>), it will shift the depth values to prevent <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Z-fighting"><param name="text" value="<html><u>Z-fighting</u></html>"><param name="textColor" value="blue"></object>.</td>
</tr>
</table></div>
<!-- EDIT7 TABLE [10970-12683] -->
<!-- EDIT7 TABLE [16304-18289] -->
</div>
<div>
<div><sup><a href="#fnt__1">1)</a></sup>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

@ -444,15 +444,9 @@ Use the following methods to move physics objects.
<tr>
<td> applyForce(…) </td><td> Move (push) the object once with a certain moment, expressed as a Vector3f. Optionally, you can specify where on the object the pushing force hits. </td>
</tr>
<tr>
<td> applyContinuousForce(…) </td><td> Keep moving (pushing) the object with continuous force in one direction, expressed as a Vector3f. Optionally, you can specifiy where on the object the pushing force hits. You can <code>applyContinuousForce(false)</code> to stop the force. </td>
</tr>
<tr>
<td> applyTorque(…) </td><td> Rotate (twist) the object once around its axes, expressed as a Vector3f. </td>
</tr>
<tr>
<td> applyContinuousTorque(…) </td><td> Keep rotating (twisting) the object continuously around its axes, expressed as a Vector3f. You can <code>applyContinuousTorque(false)</code> to stop the rotation.</td>
</tr>
<tr>
<td> applyImpulse(…) </td><td> An idealised change of momentum. This is the kind of push that you would use on a pool billiard ball. </td>
</tr>
@ -466,7 +460,7 @@ Use the following methods to move physics objects.
<td>clearForces()</td><td>Cancels out all forces (force, torque) etc and stops the motion.</td>
</tr>
</table></div>
<!-- EDIT5 TABLE [13584-15257] -->
<!-- EDIT5 TABLE [13584-14809] -->
<p>
<strong>Note:</strong> It is technically possible to position PhysicsControls using setLocalTranslation(), e.g. to place them in their start position in the scene. However you must be very careful not to cause an &quot;impossible state&quot; where one physical object overlaps with another! Within the game, you typically use the setters shown here exclusively.
@ -501,7 +495,7 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
<td> setSleepingThreshold(float,float)</td><td>Sets the sleeping thresholds wich define when the object gets deactivated to save ressources. Low values keep the object active when it barely moves. The first value is the linear threshold and the second the angular.</td>
</tr>
</table></div>
<!-- EDIT6 TABLE [15653-16648] -->
<!-- EDIT6 TABLE [15205-16200] -->
</div>
<h2><a>Best Practices</a></h2>

@ -4,23 +4,38 @@
<p>
The simplest type of Meshes are the built-in JME Shapes. You can create Shapes without using the AssetManager.
</p>
</div>
<h2><a>List of 3D shapes</a></h2>
<h2><a>3D shapes</a></h2>
<div>
<p>
<img src="/wiki/lib/exe/fetch.php"><img src="/wiki/lib/exe/fetch.php"><img src="/wiki/lib/exe/fetch.php">
</p>
<ul>
<li><div> com.jme3.scene.shape.Box – A cube or cuboid. Single-sided Quad faces (outside only). </div>
</li>
<li><div> com.jme3.scene.shape.StripBox – A cube or cuboid. Solid filled faces (inside and outside).</div>
</li>
</ul>
<ul>
<li><div> com.jme3.scene.shape.Cylinder – A disk or pillar.</div>
</li>
<li><div> com.jme3.scene.shape.Sphere – A ball or elipsoid.</div>
<li><div> com.jme3.scene.shape.Sphere – A ball or elipsoid. </div>
</li>
<li><div> com.jme3.scene.shape.Dome – A semi-sphere, e.g. SkyDome. </div>
</ul>
<p>
<img src="/wiki/lib/exe/fetch.php"><img src="/wiki/lib/exe/fetch.php"><img src="/wiki/lib/exe/fetch.php">
</p>
<ul>
<li><div> com.jme3.scene.shape.Dome – A semi-sphere, e.g. SkyDome.</div>
<ul>
<li><div> For a cone, set the Dome&#039;s radialSamples&gt;4 and planes=2. </div>
</li>
@ -28,9 +43,11 @@ The simplest type of Meshes are the built-in JME Shapes. You can create Shapes w
</li>
</ul>
</li>
</ul>
<ul>
<li><div> com.jme3.scene.shape.Torus – An single-holed torus or &quot;donut&quot;.</div>
</li>
<li><div> com.jme3.scene.shape.PQTorus – A parameterized torus. A PQ-Torus looks like a <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Torus_knot"><param name="text" value="<html><u>donut knotted into spirals</u></html>"><param name="textColor" value="blue"></object>.</div>
<li><div> com.jme3.scene.shape.PQTorus – A parameterized torus. A PQ-Torus looks like a <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Torus_knot"><param name="text" value="<html><u>donut knotted into spirals</u></html>"><param name="textColor" value="blue"></object>. <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nurbs_3-d_surface.png"><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/220px-trefoil_knot_arb.png"><img src="/wiki/lib/exe/fetch.php"></div>
</li>
<li><div> com.jme3.scene.shape.Surface – A curved surface (called <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/File:NURBS_3-D_surface.gif"><param name="text" value="<html><u>NURBS</u></html>"><param name="textColor" value="blue"></object>) described by knots, weights and control points. Compare with shape.Curve.</div>
</li>
@ -38,7 +55,7 @@ The simplest type of Meshes are the built-in JME Shapes. You can create Shapes w
</div>
<h2><a>List of Non-3D shapes</a></h2>
<h2><a>Non-3D shapes</a></h2>
<div>
<ul>
<li><div> com.jme3.scene.shape.Quad – A flat 2D rectangle (has two sides)</div>
@ -51,10 +68,11 @@ The simplest type of Meshes are the built-in JME Shapes. You can create Shapes w
</div>
<h3><a>Math versus Shape?</a></h3>
<h4><a>Math versus Shape?</a></h4>
<div>
<p>
Do not mix up these visible Shapes with similarly named classes from the maths package. Choose the right package when letting your IDE fill in the import statements!
</p>
<ul>
@ -70,7 +88,6 @@ Do not mix up these visible Shapes with similarly named classes from the maths p
<p>
These maths objects are invisible and are used for collision testing (ray casting) or to describe motion paths. They cannot be wrapped into a Geometry.
</p>
</div>
@ -80,7 +97,7 @@ These maths objects are invisible and are used for collision testing (ray castin
</div>
<h3><a>Basic Usage</a></h3>
<h4><a>Basic Usage</a></h4>
<div>
<p>
@ -99,7 +116,7 @@ To add a shape to the scene:
</div>
<h3><a>Complex Shapes</a></h3>
<h4><a>Complex Shapes</a></h4>
<div>
<p>
@ -119,11 +136,7 @@ You can compose more complex custom Geometries out of simple Shapes. Think of th
</ol>
<p>
The order is important: First arrange around origin, then transform. Otherwise, transformations are applied around the wrong center (pivot). Of course, you can attach your constellation to other pivot Nodes to create even more complex shapes (a chair, a furnished room, a house, a city, …), but again, arrange them around the origin first before you transform them.
<br/>
Note: Obviously, these composed Geometries are simpler than hand-sculpted meshes from a mesh editor.
The order is important: First arrange around origin, then transform. Otherwise, transformations are applied around the wrong center (pivot). Of course, you can attach your constellation to other pivot Nodes to create even more complex shapes (a chair, a furnished room, a house, a city, …), but again, arrange them around the origin first before you transform them. Obviously, such composed Geometries are simpler than hand-sculpted meshes from a mesh editor.
</p>
</div>

@ -11,9 +11,12 @@ This is a draft of a feature that is work in progress. If you have questions or
<h2><a>Requirements</a></h2>
<div>
</div>
<h3><a>Developer Requirements</a></h3>
<div>
<ul>
<li><div> Android device that supports OpenGL ES 2.0</div>
</li>
<li><div> Install <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://developer.android.com/sdk/index.html"><param name="text" value="<html><u>Android SDK 2.2</u></html>"><param name="textColor" value="blue"></object> or better.</div>
</li>
<li><div> Install jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym></div>
@ -34,6 +37,19 @@ This is a draft of a feature that is work in progress. If you have questions or
</div>
<h3><a>User Requirements</a></h3>
<div>
<ul>
<li><div> Android 2.2 device or better</div>
</li>
<li><div> Graphic card that supports OpenGL ES 2.0 or better</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/groups/android/forum/topic/does-my-phone-meet-the-requirements-necessary-to-run-jmonkeyengine-3/"><param name="text" value="<html><u>Does my phone meet the requirements necessary to run jMonkeyEngine 3?</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>Features</a></h2>
<div>

@ -109,22 +109,37 @@ A rotating object is just a simple example. In the update loop, you typically ha
</div>
<h2><a>Init versus Update</a></h2>
<h2><a>Init - Update - Render</a></h2>
<div>
<p>
Note the contrast: The <code>simpleUpdate()</code> method runs repeatedly, while the <code>simpleInitApp()</code> method is executed only once, right at the beginning. These two are the most important methods in a SimpleApplication-derived game. From these two methods, you create other class instances (your game data) and change their properties (your game state).
Note the contrast:
</p>
<ul>
<li><div> The <code>simpleInitApp()</code> method is executed only once, right at the beginning; </div>
</li>
<li><div> The <code>simpleUpdate()</code> method runs repeatedly, during the game. </div>
</li>
<li><div> After every update, the jMonkeyEngine automatically redraws (<code>renders</code>) the screen for you!</div>
</li>
</ul>
<p>
Since rendering is automatic, initialization and updating are the two most important concepts in a SimpleApplication for you right now. These methods are where you load and create game data (once), and (repeatedly) change their properties to update the game state:
</p>
<ul>
<li><div> <code>simpleInitApp()</code> is the application&#039;s &quot;first breath&quot;.</div>
</li>
<li><div> <code>simpleUpdate()</code> is the application&#039;s heartbeat.</div>
<li><div> <code>simpleUpdate()</code> is the application&#039;s heartbeat. <br/>
The update time unit is called <code>ticks</code>.</div>
</li>
</ul>
<p>
Basically everything in your game happens in either one or the other method. This means that these methods grow very long over time. There are two strategies how advanced developers can spread out their init and update code over several Java classes:
<p><div>Everything in a game happens either during initialization or during the update loop. This means that these two methods grow very long over time. There are two strategies how experienced developers spread out their init and update code over several Java classes:
</p>
<ul>
<li><div> Move code blocks from the simpleInitApp() method to <a href="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">AppStates</a>.</div>
@ -134,7 +149,9 @@ Basically everything in your game happens in either one or the other method. Thi
</ul>
<p>
Keep this in mind for later when your game application grows.
Keep this in mind for later when your application grows.
</div></p>
</p>
</div>

@ -716,8 +716,19 @@ FloatTexture, TextureCompressionLATC, NonPowerOfTwoTextures]</pre>
<h3><a>How do I optimize the heck out of the Scene Graph?</a></h3>
<div>
<p>
You can batch all Geometries in a scene (or a subnode) that remains static.
</p>
<pre>jme3tools.optimize.GeometryBatchFactory.optimize&#40;rootNode&#41;;</pre>
<p>
Batching means that all Geometries with the same Material are combined into one mesh. This optimization only has an effect if you use only few (roughly up to 32) Materials total. The pay-off is that batching takes extra time when the game is initialized.
</p>
</div>
<h2><a>I want to do maths</a></h2>

@ -47,7 +47,8 @@
<link rel='stylesheet' id='rpx_style-css' href='http://jmonkeyengine.org/wp-content/plugins/rpx/files/stylesheet.css?ver=3.2.1' type='text/css' media='all' />
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/l10n.js?ver=20101110'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/emailprotect/EMAILProtect.js?ver=0.8'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/jquery.js?ver=1.6.1'></script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script>
<script type='text/javascript'>try{jQuery.noConflict();}catch(e){};</script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/explanatory-dictionary/javascript/scripts.js?ver=3.2.1'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/google-custom-search/js/gsc.js?ver=3.2.1'></script>
<script type='text/javascript' src='http://www.google.com/jsapi?ver=3.2.1'></script>
@ -150,7 +151,7 @@ var NS='jme3:intermediate';var JSINFO = {"id":"jme3:intermediate:headlessserver"
<select><option value="wiki">Wiki</option><option value="forums">Forums</option><option value="posts">Blog</option><option value="groups">Groups</option><option value="links">Links</option></select>
<input type="submit" name="search-submit" id="search-submit" value="Search" />
<input type="hidden" id="_wpnonce" name="_wpnonce" value="e8bdb80144" /><input type="hidden" name="_wp_http_referer" value="/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html" />
<input type="hidden" id="_wpnonce" name="_wpnonce" value="3508447626" /><input type="hidden" name="_wp_http_referer" value="/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html" />
</form><!-- #search-form -->
@ -306,7 +307,7 @@ You&#039;ve followed a link to a topic that doesn&#039;t exist yet. If permissio
<div>
<form><div><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="" /><input type="submit" value="Show pagesource" class="button" accesskey="v" title="Show pagesource [V]" /></div></form> <form><div><input type="hidden" name="do" value="revisions" /><input type="submit" value="Old revisions" class="button" accesskey="o" title="Old revisions [O]" /></div></form> </div>
<div>
<form><div><input type="hidden" name="do" value="login" /><input type="hidden" name="sectok" value="b273fed70c8f61e2ac778ef448e51618" /><input type="submit" value="Login" class="button" title="Login" /></div></form> <form><div><input type="hidden" name="do" value="index" /><input type="submit" value="Sitemap" class="button" accesskey="x" title="Sitemap [X]" /></div></form> <a><input type="button" class="button" value="Back to top" onclick="window.scrollTo(0, 0)" title="Back to top" /></a>&nbsp;
<form><div><input type="hidden" name="do" value="login" /><input type="hidden" name="sectok" value="6f139d65a3f955caf3492f84be10ab4e" /><input type="submit" value="Login" class="button" title="Login" /></div></form> <form><div><input type="hidden" name="do" value="index" /><input type="submit" value="Sitemap" class="button" accesskey="x" title="Sitemap [X]" /></div></form> <a><input type="button" class="button" value="Back to top" onclick="window.scrollTo(0, 0)" title="Back to top" /></a>&nbsp;
</div>
<div></div>
</div-->
@ -348,16 +349,9 @@ You&#039;ve followed a link to a topic that doesn&#039;t exist yet. If permissio
</ul></div></div><!-- #wp-admin-bar -->
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.core.js?ver=1.8.12'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.widget.js?ver=1.8.12'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.mouse.js?ver=1.8.12'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.resizable.js?ver=1.8.12'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.draggable.js?ver=1.8.12'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.button.js?ver=1.8.12'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.position.js?ver=1.8.12'></script>
<script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.dialog.js?ver=1.8.12'></script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js'></script>
<!-- Generated in 0.417 seconds. (76 q) -->
<!-- Generated in 0.291 seconds. (76 q) -->
<div>
<div></div>

@ -53,6 +53,10 @@ The <strong>jME Context</strong> makes settings, renderer, timer, input and even
<h1><a>Geometry</a></h1>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png">
</p>
</div>
<h2><a>Coordinates</a></h2>
@ -60,12 +64,8 @@ The <strong>jME Context</strong> makes settings, renderer, timer, input and even
<p>
Coordinates represent a location in a coordinate system, relative to the origin (0,0,0). m. In 3D space, you need to specify three coordinate values to locate a point: x,y,z.
As opposed to a vector (which looks similar), a coordinate does not have a &quot;direction&quot;.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png">
Coordinates represent a location in a coordinate system. Coordinates are relative to the origin at (0,0,0). In 3D space, you need to specify three coordinate values to locate a point: X (right), Y (up), Z (towards you).
In contrast to a vector (which looks similar), a coordinate is a location, not a direction.
</p>
</div>
@ -75,8 +75,11 @@ As opposed to a vector (which looks similar), a coordinate does not have a &quot
<p>
The origin is the central point in the 3D world. It&#039;s at the coordinates (0,0,0).
Code sample: <code>Vector3f origin = new Vector3f( Vector3f.ZERO );</code>
The origin is the central point in the 3D world, where the three axes meet. It&#039;s at the coordinates (0,0,0).
</p>
<p>
<strong>Example:</strong> <code>Vector3f origin = new Vector3f( Vector3f.ZERO );</code>
</p>
</div>
@ -86,8 +89,11 @@ Code sample: <code>Vector3f origin = new Vector3f( Vector3f.ZERO );</code>
<p>
A vector has a length and a direction. It is used like an arrow pointing at a point in 3D space. A vector starts at the origin (0,0,0), and ends at the target coordinate (x,y,z). Backwards directions are expressed with negative values.
Code sample: <code>Vector3f v = new Vector3f( 17 , -4 , 0 );</code>
A vector has a length and a direction, like an arrow in 3D space. A vector starts at the origin (0,0,0), and ends at the target coordinate (x,y,z). Backwards directions are expressed with negative values.
</p>
<p>
<strong>Example:</strong> <code>Vector3f v = new Vector3f( 17 , -4 , 0 );</code>
</p>
</div>
@ -131,12 +137,12 @@ When you normalize a vector, it still has the same direction, but you lose the i
</div>
<h3><a>Surface Normals</a></h3>
<h3><a>Surface Normal Vectors</a></h3>
<div>
<p>
A surface normal is a vector that is perpendicular to a plane.
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/300px-surface_normal.png">
A surface normal is a vector that is perpendicular (orthogonal) to a plane.
You calculate the Surface Normal by calculating the cross product.
</p>
@ -288,7 +294,13 @@ Set the Specular color to ColorRGBA.Black to switch off shininess.</div>
<p>
Textures are part of Materials. In the simplest case, an object could have just one texture, the Color Map, loaded from one image file. When you think back of old computer games you&#039;ll remember this looks quite plain.
</p>
<p>
The more information you (the game designer) provide additionally to the Color Map, the higher the degree of detail and realism. Whether you want photo-realistic rendering or &quot;toon&quot; rendering (Cel Shading), everything depends on the quality of your materials and texture maps. Modern 3D graphics use several layers of information to describe one material, each layer is a Texture Map.
<p><div>You have no textures? <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://opengameart.org"><param name="text" value="<html><u>Download free textures</u></html>"><param name="textColor" value="blue"></object> (including texture maps) from opengameart.org.
</div></p>
</p>
</div>
@ -298,44 +310,39 @@ The more information you (the game designer) provide additionally to the Color M
</div>
<h3><a>Color Map</a></h3>
<h3><a>Color Map / Diffuse Map</a></h3>
<div>
<p>
<img src="/wiki/lib/exe/fetch.php">
</p>
<ul>
<li><div> A simple image file (or a procedural texture).</div>
<li><div> A plain image file or a procedural texture that describes an object&#039;s visible surface.</div>
</li>
<li><div> The image can have alpha channels for transparency.</div>
</li>
<li><div> <strong>A color map is the minimum texture you need.</strong> All other texture maps are optional improvements.</div>
<li><div> <strong>A Color Map is the minimum texture.</strong> You can add texture maps as optional improvements. </div>
</li>
<li><div> Color Maps are called Diffuse Map in a Phong-illuminated Material, because the map defines the basic colors of light that are diffused by this object.</div>
</li>
</ul>
<p>
<img src="/wiki/lib/exe/fetch.php">
</p>
</div>
<h3><a>Diffuse Map</a></h3>
<h3><a>Bump Map</a></h3>
<div>
<p>
Bump maps are used to describe detailed shapes that would be too hard or simply too inefficient to sculpt in a mesh editor. There are two types:
</p>
<ul>
<li><div> The Diffuse Map specifies the intensity of color.</div>
<li><div> You use Normal Maps to model tiny details such as cracks in walls, rust, skin texture, or a canvas weave ( (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Bump_mapping"><param name="text" value="<html><u>More on BumpMaps</u></html>"><param name="textColor" value="blue"></object>). </div>
</li>
<li><div> Its basically the same as a Color Map but its called Diffuse Map in a lighting environment, as it defines the color the object &quot;diffuses&quot;.</div>
<li><div> You use Height Maps to model large terrains with valleys and mountains.</div>
</li>
</ul>
</div>
<h3><a>Bump Map</a></h3>
<div>
<p>
Bump maps are used to describe detailed shapes that would be too hard or simply too inefficient to sculpt in a mesh editor. You use Normal Maps to model cracks in walls, rust, skin texture, or a canvas weave. You use Height Maps to model whole terrains with valleys and mountains.
<img src="/wiki/lib/exe/fetch.php">
</p>
@ -362,11 +369,11 @@ Bump maps are used to describe detailed shapes that would be too hard or simply
<img src="/wiki/lib/exe/fetch.php">
</p>
<ul>
<li><div> A well-done Normal Map makes a shape more detailed–without the need to add costly polygons to the mesh. It contains shading information that makes the object appear smoother and more fine-grained.</div>
<li><div> A well-done Normal Map makes a shape more detailed without the need to add costly polygons to the mesh. It contains shading information that makes the object appear smoother and more fine-grained.</div>
</li>
<li><div> The Normal Map is displayed looking like a false-color version of the Color Map–but it is never used for coloring, instead, each RGB value encodes transformation data. This displacement data is represented by Surface Normals of the slopes, hence the name.</div>
<li><div> When you open a Normal Map in an image editor, it looks like a false-color version of the Color Map. Normal maps however are never used for coloring, instead, each the color values encode displacement data of bumps and cracks on the surface. Displacement data is represented by the Surface Normals of the slopes, hence the name.</div>
</li>
<li><div> It&#039;s hard to draw normal maps by hand. Generally you use software tools to calculate them off 3D models.</div>
<li><div> You cannot draw normal maps by hand, professional designers use software to calculate them off high-quality 3D models. </div>
</li>
</ul>
@ -381,9 +388,9 @@ Bump maps are used to describe detailed shapes that would be too hard or simply
<ul>
<li><div> A Specular Map further improves the realism of an object&#039;s surface: It contains extra information about shininess and makes the shape appear more realistically illumated.</div>
</li>
<li><div> Start out with a gray value that corresponds to the average shininess/dullness of this material. Then add ligher grays for smoother, shinier, more reflective areas; and darker grays for duller, rougher, worn-out areas. The resulting image file looks similar to a grayscale version of the Color Map.</div>
<li><div> Start out with a copy of the Diffuse Map in a medium gray that corresponds to the average shininess/dullness of this material. Then add ligher grays for smoother, shinier, more reflective areas; and darker grays for duller, rougher, worn-out areas. The resulting image file looks similar to a grayscale version of the Diffuse Map.</div>
</li>
<li><div> You can use colors in a specular map to create certain reflective effects (iridiscence, metallic).</div>
<li><div> You can use colors in a specular map to create certain reflective effects (fake iridiscence, metallic effect).</div>
</li>
</ul>
@ -394,9 +401,11 @@ Bump maps are used to describe detailed shapes that would be too hard or simply
<p>
<img src="/wiki/lib/exe/fetch.php">
This is a very simple, commonly used type of texture. When texturing a wide area (e.g. walls, floors), you don&#039;t create one huge texture, instead you tile a small texture repeatedly to fill the area.
A seamless texture is an image file that has been designed so that it can be used as tiles: The right edge matches the left edge, and the top edge matches the bottom edge. The onlooker cannot easily tell where one starts and the next one ends, thus creating an illusion of a huge texture. The downside is that the tiling becomes painfully obvious when the area is viewed from a distance. Also you cannot use it on more complex models such as characters.
Tiles are a very simple, commonly used type of texture. When texturing a wide area (e.g. walls, floors), you don&#039;t create one huge texture instead you tile a small texture repeatedly to fill the area.
</p>
<p>
A seamless texture is an image file that has been designed so that it can be used as tiles: The right edge matches the left edge, and the top edge matches the bottom edge. The onlooker cannot easily tell where one starts and the next one ends, thus creating an illusion of a huge texture. The downside is that the tiling becomes painfully obvious when the area is viewed from a distance. Also you cannot use it on more complex models such as characters.
</p>
</div>
@ -410,7 +419,7 @@ A seamless texture is an image file that has been designed so that it can be use
</p>
<p>
Creating a texture for a cube is easy – but what about a character with a face and extremities? For more complex objects, you design the texture in the same ways as a sewing pattern: One image file contains the outline of the front, back, and side of the object, next to one another. Specific areas of the flat texture (UV coordinates) map onto certain areas of your 3D model (XYZ coordinates), hence the name UV map. Using UV Maps, models can have a different texture on each side.
Creating a texture for a cube is easy – but what about a character with a face and extremities? For more complex objects, you design the texture in the same ways as a flat sewing pattern: One image file contains the outline of the front, back, and side of the object, next to one another. Specific areas of the flat texture (UV coordinates) map onto certain areas of your 3D model (XYZ coordinates), hence the name UV map. Using UV Maps, one model can have different textures on each side.
</p>
<p>
@ -428,8 +437,11 @@ Getting the seams and mappings right is crucial: You must use a graphic tool lik
</p>
<p>
Environment Maps are used to create the impression of reflections and refractions. You create a Cube Map to represent your environment, similar to a skybox. (Sphere Maps are possible, but often look too distorted.) You give the Cube Map a set of images showing a &quot;360° view&quot; of the completed scene. The renderer uses this as base to texture the reflective surface.
Of course these reflections are static and not &quot;real&quot;, e.g. the player will not see his avatar&#039;s face reflected, etc… But they cause the desired &quot;glass/mirror/water&quot; effect, and are fast enough to render in real usecases, it&#039;s better than nothing.
Environment Maps are used to create the impression of reflections and refractions. You create a Cube Map to represent your environment, similar to a skybox. (Sphere Maps are possible, but often look distorted.) You give the Cube Map a set of images showing a &quot;360° view&quot; of the completed scene. The renderer uses this as base to texture the reflective surface.
</p>
<p>
Of course the reflected environment is static and not &quot;real&quot;, e.g. the player will not see his avatar&#039;s face reflected, etc. But EnvMaps cause the desired &quot;glass/mirror/water&quot; effect, and are fast enough to render in real usecases.
</p>
</div>
@ -439,7 +451,7 @@ Of course these reflections are static and not &quot;real&quot;, e.g. the player
<p>
You provide the texture in two or three resolutions to be stored in one file (MIP = &quot;multum in parvo&quot; = &quot;many in one&quot;). Depending on how close (or far) the camera is, the engine automatically renders a more (or less) detailed texture for the object. Thus objects look smooth from close up, but don&#039;t waste resources with unspottable details when far away. Good for everything, but requires more time to create and more space to store textures.
MIP Map means that you provide one texture in two or three resolutions in one file (MIP = &quot;multum in parvo&quot; = &quot;many in one&quot;). Depending on how close (or far) the camera is, the engine automatically renders a more (or less) detailed texture for the object. Thus objects look smooth from close up, but don&#039;t waste resources with unspottable details when far away. Good for everything, but requires more time to create and more space to store textures. If you don&#039;t provide custom ones, the jMonkeyEngine creates basic MIP maps automatically as an optimization.
</p>
</div>
@ -449,7 +461,7 @@ You provide the texture in two or three resolutions to be stored in one file (MI
<p>
A procedural texture is generated from repeating one small image, plus some pseudo-random, gradient variations (Perlin noise). Procedural textures look more natural than static rectangular textures, for instance, they look less distorted on spheres. On big meshes, their repetitiveness is much less noticable than tiled seamless textures. Procedural textures are ideal for irregular large-area textures like grass, soil, rock, rust, and walls. See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/wiki/doku.php/sdk:neotexture"><param name="text" value="<html><u>jMonkeyEngine SDK NeoTexture plugin</u></html>"><param name="textColor" value="blue"></object>
A procedural texture is generated from repeating one small image, plus some pseudo-random, gradient variations (called Perlin noise). Procedural textures look more natural than static rectangular textures, and they look less distorted on spheres. On big meshes, their repetitiveness is much less noticable than with tiled seamless textures. Procedural textures are ideal for irregular large-area textures like grass, soil, rock, rust, and walls. Use the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/wiki/doku.php/sdk:neotexture"><param name="text" value="<html><u>jMonkeyEngine SDK NeoTexture plugin</u></html>"><param name="textColor" value="blue"></object> to create them.
</p>
<p>
@ -467,8 +479,11 @@ See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<p>
In 3D games, Skeletal Animation is used for animated characters, but in principle the skeleton approach can be extended to any 3D mesh (for example, an opening crate&#039;s hinge can be considered a joint).
Unless you animate a 3D cartoon, realism of animated characters is generally a problem: Movement can look alien-like mechanical or broken, the character appears hollow, or as if floating. Professional game designers invest a lot of effort to make characters animate in a natural way (including motion capturing).
In 3D games, Skeletal Animation is used for animated characters, but in principle the skeleton approach can be extended to any 3D mesh (for example, an opening crate&#039;s hinge can be considered a primitive joint).
</p>
<p>
Unless you animate a 3D cartoon, realism of animated characters is generally a problem: Movement can look alien-like mechanical or broken, the character appears hollow, or as if floating. Professional game designers invest a lot of effort to make characters animate in a natural way, including <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Motion_capture"><param name="text" value="<html><u>motion capture</u></html>"><param name="textColor" value="blue"></object>.
</p>
</div>

Loading…
Cancel
Save