<li><div> (For the release build:) Use the jMonkeyPlatform to convert models to .j3o format. You don't need this step as long you still develop and test the aplication within the jMonkeyPlatform.</div>
<li><div> (For the release build:) Use the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> to convert models to .j3o format. You don't need this step as long you still develop and test the aplication within the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.</div>
</li>
</ol>
@ -77,8 +77,8 @@ To export your models as Ogre <acronym title="Extensible Markup Language">XML</a
<p>
You can now use the <ahref="/com/jme3/gde/core/docs/sdk.html">jMonkeyPlatform</a> to <ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">load and view models</a>. You can <ahref="/com/jme3/gde/core/docs/sdk/scene_composer.html">create scenes</a> from them and write cde that loads them into your application.
You can now use the <ahref="/com/jme3/gde/core/docs/sdk.html">jMonkeyEngine SDK</a> to <ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">load and view models</a>. You can <ahref="/com/jme3/gde/core/docs/sdk/scene_composer.html">create scenes</a> from them and write cde that loads them into your application.
@ -36,7 +36,7 @@ Additionally, You can configure the Asset Manager and add any path to its root.
<p>
By default, jME3 searches for models in a directory named <code>assets</code>. <strong>In Java projects created with the jMonkeyPlatform, an assets folder is created by default.</strong> Using any other IDE or the command line, you have to create this assets directory as an extra step (see the Codeless Project tip below).
By default, jME3 searches for models in a directory named <code>assets</code>. <strong>In Java projects created with the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, an assets folder is created by default.</strong> Using any other IDE or the command line, you have to create this assets directory as an extra step (see the Codeless Project tip below).
If you use the default build script created by the jMonkeyPlatform then <strong>the original OgreXML files are not included in the executable.</strong> A stand-alone executable <strong>works with .j3o files only</strong>. The default build script makes sure to include .j3o files in the executable.
If you use the default build script created by the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> then <strong>the original OgreXML files are not included in the executable.</strong> A stand-alone executable <strong>works with .j3o files only</strong>. The default build script makes sure to include .j3o files in the executable.
</p>
<p>
@ -168,10 +168,10 @@ If you use the default build script created by the jMonkeyPlatform then <strong>
</p>
<p>
Before building the executable, you must use the jMonkeyPlatform's context menu action to <ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">convert OgreXML models to .j3o format</a>.
Before building the executable, you must use the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>'s context menu action to <ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">convert OgreXML models to .j3o format</a>.
</p>
<ol>
<li><div> Open the kME3 Project in the jMonkeyplatform.</div>
<li><div> Open the kME3 Project in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.</div>
</li>
<li><div> Browse the <code>assets</code> directory in the Projects window. </div>
</li>
@ -195,14 +195,14 @@ If you load the scene from a non.j3o ZIP file, expand the <a href="/com/jme3/gde
<p>
If you are using another IDE than jMonkeyPlatform for coding, you should create a so-called codeless project in the jMonkeyPlatform to maintain assets. This method will not meddle with your sources or custom build scripts. It simply makes it easier for you to browse game assets, and preview, arrange, and especially convert models to binary.
If you are using another IDE than jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> for coding, you should create a so-called codeless project in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> to maintain assets. This method will not meddle with your sources or custom build scripts. It simply makes it easier for you to browse game assets, and preview, arrange, and especially convert models to binary.
</p>
<ul>
<li><div> You use your favorite IDE to code and use the jMonkeyPlatform only for jME3 assets maintenance.</div>
<li><div> You use your favorite IDE to code and use the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> only for jME3 assets maintenance.</div>
</li>
<li><div> You can also ask the graphic designers in your team to install the jMonkeyPlatform and give them access to such a codeless project.</div>
<li><div> You can also ask the graphic designers in your team to install the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> and give them access to such a codeless project.</div>
A <code>com.jme3.scene.control.Control</code> is a customizable jME3 interface that allows you to cleanly implement game logic, such as game rules, or artificially intelligent behaviour in NPCs. You use Controls to control the behaviour of types of spatials. To control global game behaviour see <ahref="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> – you can use both together.
A <code>com.jme3.scene.control.Control</code> is a customizable jME3 interface that allows you to cleanly steer the behaviour of game entities: Traps, alarms, doors, animal NPCs, self-steering vehicles, artificially intelligent behaviour in NPCs, anything that moves. Several instances of Controls together implement the behaviours of a type of Spatial. To control global game behaviour see <ahref="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> – you can also use both together.
</p>
<ul>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://www.youtube.com/watch?v=MNDiZ9YHIpM"><paramname="text"value="<html><u>Quick video introduction to Custom Controls</u></html>"><paramname="textColor"value="blue"></object></div>
</li>
</ul>
<p>
To control the behaviour of types of entities:
</p>
<ol>
<li><div> Create one control for each type of behavior. When you add several controls to one spatial, they will be executed in the order they were added. <br/>
For example, an NPC can be controlled by a PhysicsControl and an AIControl.</div>
</li>
<li><div> You define a custom control and implement its behaviour in the Control's update() method.</div>
<li><div>Define the custom control and implement its behaviour in the Control's update() method:</div>
<ul>
<li><div> In the control, you can pass arguments and manipulate the spatial in any way: Modify its transformation (move, scale, rotate), play animations, check for enemies around it and react, etc.</div>
<li><div> You can pass arguments into your custom control.</div>
</li>
<li><div> In the control class, the object <code>spatial</code> gives you access to the spatial that the control is attached to.</div>
</li>
<li><div> Modify the <code>spatial</code>'s transformation (move, scale, rotate), play animations, check for enemies around it and react, etc. </div>
</li>
</ul>
</li>
<li><div> Add the control to a spatial and the Spatial's game state is updated automatically from now on. <br/>
<code>spatial.addControl(myControl)</code></div>
<li><div> Add an instance of the control to a spatial, and the Spatial's game state is updated automatically from now on. <pre>spatial.addControl(myControl);</pre>
</div>
</li>
</ol>
@ -98,7 +110,7 @@ If you want to create a Control that also extends an existing class, then create
@Override
public Control cloneForSpatial(Spatial spatial){
ControlledThing control = new ControlledThing(y);
// ...
// ... // set custom properties
spatial.setControl(control);
return control;
}
@ -151,7 +163,7 @@ This class can be found under <code>com.jme3.scene.control.AbstractControl</code
</ul>
<p>
Usage: Your custom subclass must implement the three methods <code>controlUpdate()</code>, <code>controlRender()</code>, and <code>cloneForSpatial()</code> as shown here:
Usage: Your custom subclass implements the three methods <code>controlUpdate()</code>, <code>controlRender()</code>, and <code>cloneForSpatial()</code> as shown here:
</p>
<pre>public class MyControl extends AbstractControl implements Savable, Cloneable {
@ -165,16 +177,17 @@ Usage: Your custom subclass must implement the three methods <code>controlUpdate
jME3 supports various post-rendering and particle effects. This list contains screenshots and sample code that demonstrates how to add the effect to a scene.
jME3 supports two types of effects, post-rendering filters and particle emitters. This list contains screenshots and links to sample code that demonstrates how to add the effect to a scene.
</p>
<p>
For example, post-processor filter effects are typically activated after the following pattern:
</p>
<pre>public class MyGame extends SimpleApplication {
private FilterPostProcessor fpp;
private SomeFilter sf;
public void simpleInitApp(){
...
fpp = new FilterPostProcessor(assetManager);
The jMonkeyEngine features <ahref="/com/jme3/gde/core/docs/jme3/advanced/water.html">"SeaMonkey" water effect</a> including cool underwater caustics.
</p>
<p>
See also the <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/2011/01/15/new-advanced-water-effect-for-jmonkeyengine-3"><paramname="text"value="<html><u>Rendering Water as Post-Process Effect</u></html>"><paramname="textColor"value="blue"></object> announcement with video.
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/2010/08/16/screen-space-ambient-occlusion-for-jmonkeyengine-3-0/#more-321"><paramname="text"value="<html><u>Screen Space Ambient Occlusion for jMonkeyEngine</u></html>"><paramname="textColor"value="blue"></object> (article)</div>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/2011/01/15/new-advanced-water-effect-for-jmonkeyengine-3/#comment-609"><paramname="text"value="<html><u>Rendering Water as Post-Process Effect</u></html>"><paramname="textColor"value="blue"></object></div>
See also: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/2010/08/16/screen-space-ambient-occlusion-for-jmonkeyengine-3-0/#more-321"><paramname="text"value="<html><u>Screen Space Ambient Occlusion for jMonkeyEngine</u></html>"><paramname="textColor"value="blue"></object> (article)
<ahref="/com/jme3/gde/core/docs/jme3/advanced/particle_emitters.html">Particle emitter effects</a> can have any texture, e.g. fog, smoke, leaves, meteors, snowflakes, mosquitos, fire, sparks…
@ -186,7 +186,7 @@ The recommended approach to create HUDs is using <a href="/com/jme3/gde/core/doc
<p>
The advantage of Nifty <acronymtitle="Graphical User Interface">GUI</acronym> is that it is well integrated into jME and the jMonkeyPlatform, and that it offers all the features that you expect from a professional modern user interface.
The advantage of Nifty <acronymtitle="Graphical User Interface">GUI</acronym> is that it is well integrated into jME and the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, and that it offers all the features that you expect from a professional modern user interface.
</p>
<p>
@ -200,4 +200,4 @@ For HUDs, you basically follow the same instructions as for creating a normal <a
In your IDE, use code completion to quickly look up Trigger literals. In the jMonkeyPlatform for example, press ctrl-space or ctrl-/ after <code>KeyInput.|</code> to choose from the list of all keys.
In your IDE, use code completion to quickly look up Trigger literals. In the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> for example, press ctrl-space or ctrl-/ after <code>KeyInput.|</code> to choose from the list of all keys.
</p>
</div>
@ -350,4 +350,4 @@ The abstraction of separating triggers and mappings has the advantage that you c
<strong>Tip:</strong> In the jMonkeyPlatform, use File>New File>Material>Empty Material File to create .j3m files.
<strong>Tip:</strong> In the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, use File>New File>Material>Empty Material File to create .j3m files.
</p>
</div>
@ -69,10 +69,10 @@ How to this file is structured:
This is how you use the prepared .j3m Material on a Spatial. Since you have saved the .j3m file to your project's Assets directory, the .j3m path is relative to <code>MyGame/src/assets/…</code>.
<strong>Tip:</strong> In the jMonkeyPlatform, open Windows>Palette and drag the <code>JME Material: Set J3M</code> snippet into your code.
<strong>Tip:</strong> In the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, open Windows>Palette and drag the <code>JME Material: Set J3M</code> snippet into your code.
</p>
</div>
@ -175,7 +175,7 @@ All data types (except Color) are specified in com.jme3.shader.VarType.
<td> TextureArray</td><td></td><td> (Currently not supported in J3M) </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [3125-4539] -->
<!-- EDIT1 TABLE [3132-4546] -->
</div>
<h3><a>Flip and Repeat Syntax</a></h3>
@ -239,7 +239,7 @@ See the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><p
<td><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/javadoc/com/jme3/material/RenderState.html#setPointSprite(boolean)"><paramname="text"value="<html><u>PointSprite</u></html>"><paramname="textColor"value="blue"></object></td><td>(Boolean)</td><td> Enable point sprite rendering for point meshes </td>
</tr>
</table></div>
<!-- EDIT2 TABLE [5177-6745] -->
<!-- EDIT2 TABLE [5184-6752] -->
</div>
<h2><a>Examples</a></h2>
@ -251,7 +251,7 @@ See the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><p
@ -200,6 +200,44 @@ The complete list of global uniforms that can be used in JME3 can be found <obje
<br/>
</p>
</div>
<h3><a>JME3 Lighting Global uniforms</a></h3>
<div>
<p>
JME3 uses some global uniforms for lighting :
</p>
<ul>
<li><div> g_LightDirection (vec4) : the direction of the light</div>
<ul>
<li><div> use for SpotLight : x,y,z contain the world direction vector of the light, the w component contains the spotlight angle cosine </div>
</li>
</ul>
</li>
<li><div> g_LightColor (vec4) : the color of the light</div>
</li>
<li><div> g_LightPosition : the position of the light</div>
<ul>
<li><div> use for SpotLight : x,y,z contain the world position of the light, the w component contains 1/lightRange</div>
</li>
<li><div> use for PointLight : x,y,z contain the world position of the light, the w component contains 1/lightRadius</div>
</li>
<li><div> use for DirectionalLight : strangely enough it's used for the direction of the light…this might change though. The fourth component contains -1 and it's used in the lighting shader to know if it's a directionalLight or not.</div>
</li>
</ul>
</li>
<li><div> g_AmbientLightColor the color of the ambient light.</div>
</li>
</ul>
<p>
these uniforms are passed to the shader without having to declare them in the j3md file, but you have to specify in the technique definition " LightMode MultiPass" see lighting.j3md for more information.
<br/>
</p>
</div>
@ -227,36 +265,114 @@ Note that in the shader the attributes names will be prefixed by a “in”.<br/
<p>
At some point when making your own shader you'll need to pass your own uniforms<br/>
Any uniform has to be declared in the material definition file in the "MaterialParameters" section.<br/>
Any uniform has to be declared in the material definition file (.j3md) in the "MaterialParameters" section.<br/>
</p>
<pre> MaterialParameters {
Vector4 Color
Texture2D ColorMap
}</pre>
<p>
You can also pass some define to your vertex/fragment programs to know if an uniform as been declared. <br/>
You simply add it in the Defines section of your Technique in the definition file. <br/>
This material parameter will be sent from the engine to the shader as follow
</p>
<pre> material.setColor("Color", new ColorRGBA(1.0f, 0.0f, 0.0f, 1.0f);//red color</pre>
<pre> Defines {
COLORMAP: ColorMap
}</pre>
<p>
Those material parameters will be sent from the engine to the shader as follow
Note that there is a setXXXX method for any type of uniform you want to pass.<br/>
To use this uniform in the shader, you need to declare it in the .frag or in the .vert files (depending on where you need it) as follow :
</p>
<pre> uniform vec4 m_Color;</pre>
<pre> material.setColor("Color", new ColorRGBA(1.0f, 0.0f, 0.0f, 1.0f); //red color
To use this uniform in the shader, you need to declare it in the .frag or in the .vert files (depending on where you need it).
You can make use of the defines here and later in the code:
<strong>Note the "m_" prefix that specifies that the uniform is a material parameter.</strong><br/>
This uniform will be populated at runtime with the value you sent.
</p>
<pre> uniform vec4 m_Color;
#ifdef COLORMAP
uniform sampler2D m_ColorMap;
#endif</pre>
<p>
The uniforms will be populated at runtime with the value you sent.
</p>
</div>
<h3><a>Example: Adding Color Keying to the Lighting.j3md Material Definition</a></h3>
<div>
<p>
Color Keying is useful in games involving many players. It consists of adding some <br/>
player-specific color on models textures. <br/>
The easiest way of doing this is to use a keyMap which will contain the amount of <br/>
color to add in its alpha channel. <br/>
Here I will use this color map: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://wstaw.org/m/2011/10/24/plasma-desktopxB2787.jpg"><paramname="text"value="<html><u>http://wstaw.org/m/2011/10/24/plasma-desktopxB2787.jpg</u></html>"><paramname="textColor"value="blue"></object><br/>
to bend color on this texture: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://wstaw.org/m/2011/10/24/plasma-desktopbq2787.jpg"><paramname="text"value="<html><u>http://wstaw.org/m/2011/10/24/plasma-desktopbq2787.jpg</u></html>"><paramname="textColor"value="blue"></object><br/>
<br/>
We need to pass 2 new parameters to the Lighting.j3md definition, MaterialParameters section :
</p>
<pre>// Keying Map
Texture2D KeyMap
// Key Color
Color KeyColor</pre>
<p>
Below, add a new Define in the main Technique section:
</p>
<pre>KEYMAP : KeyMap</pre>
<p>
In the Lighting.frag file, define the new uniforms:
</p>
<pre>#ifdef KEYMAP
uniform sampler2D m_KeyMap;
uniform vec4 m_KeyColor;
#endif</pre>
<p>
Further, when obtaining the diffuseColor from the DiffuseMap texture, check
This way, a transparent pixel in the KeyMap texture doesn't modify the color. <br/>
A black pixel replaces it for the m_KeyColor and values in between are blended.<br/>
<br/>
A result preview can be seen here: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://wstaw.org/m/2011/10/24/plasma-desktopuV2787.jpg"><paramname="text"value="<html><u>http://wstaw.org/m/2011/10/24/plasma-desktopuV2787.jpg</u></html>"><paramname="textColor"value="blue"></object>
</p>
</div>
@ -328,7 +444,7 @@ Those attributes are deprecated since GLSL 1.3 (opengl 3), hence JME3 global uni
<td>gl_NormalMatrix </td><td>g_NormalMatrix</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [8076-8387] -->
<!-- EDIT1 TABLE [11121-11432] -->
</div>
<h3><a>Useful links</a></h3>
@ -339,4 +455,4 @@ Those attributes are deprecated since GLSL 1.3 (opengl 3), hence JME3 global uni
@ -36,7 +36,7 @@ There are tools that assist you with localizing Java Swing GUIs. jME3 applicatio
<p>
<strong>Tip:</strong> The jMonkeyPlatform supports opening and editing Bundle.properties files. Also note the Tools > Localization menu.
<strong>Tip:</strong> The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> supports opening and editing Bundle.properties files. Also note the Tools > Localization menu.
<strong>Tip:</strong> In the jMonkeyPlatform, you set this VM Option in the Project properties under Run. Here you can also save individual run configuraions for each language you want to test.
<strong>Tip:</strong> In the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, you set this VM Option in the Project properties under Run. Here you can also save individual run configuraions for each language you want to test.
<strong>Tip:</strong> You can find these and other common code snippets in the jMonkeyPlatform Code Palette. Drag and drop them into your source code.
<strong>Tip:</strong> You can find these and other common code snippets in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> Code Palette. Drag and drop them into your source code.
This table shows you which material definitions jME supplies by default, and how to make the most of your designer's 3D models by using material parameters.
If you are looking for information about how to use these materials in code, look at<ahref="/com/jme3/gde/core/docs/jme3/advanced/material_definitions.html">Material Definitions</a> and<ahref="/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html">j3M Material Files</a>.
Geometries have Materials (.j3m), Materials are based on material definitions (.j3md). You can<ahref="/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html">write .j3m files in a text editor</a>, or<ahref="/com/jme3/gde/core/docs/sdk/material_editing.html">use the jMonkeyEngine SDK to generate</a> them for you.
</p>
<p>
<strong>Tip:</strong> Looks complicated? Remember two things: The most commonly used material is Lighting.j3md (which supports Phong illumination). The<ahref="/com/jme3/gde/core/docs/sdk.html">jMonkeyPlatform</a>can create Material files, and it offers a visual editor where you can select and set properties, and preview the outcome. The Palatte contains code snippets that demo how to load materials.
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<ahref="/com/jme3/gde/core/docs/jme3/terminology#materialstextures.html">texture maps</a>are to be able to use textured materials.
</p>
</div>
<h2><a>Table of Material Definitions</a></h2>
<h2><a>Usage</a></h2>
<div>
<p>
Some parameters are "optional" because they are somewhat advanced. If you don't know what an option means, chances are that you are not using this feature in your textures – and you don't need to specify it. (E.g. YCoCg and LATC are image compression formats; Minnaert and WardIso are shader types.)
There are two types of material definitions below, illuminated and unshaded. Illuminated materials look more naturalistic, unshaded ones look more abstract.
</p>
<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's fully acceptable if it already results in the material you want. You can always add more texture maps later.
</p>
<p>
Also note that many other parameters are optional, even if they are not explicitly marked optional. For example, it's okay to specify solely the <code>DiffuseMap</code> and <code>NormalMap</code> when using <code>Lighting.j3md</code>. You are only using a subset of what is possible, but if that's what you want, you can do that. The developer should be in contact with the designer regarding what jME features individual Materials/Textures require.
<p><div>1) Looks confusing? Start with <code>Unshaded.j3md</code>, and then <code>Lighting.j3md</code>. <br/>
2) The jMonkeyEngine <ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> offers a visual editor where you can set properties and preview the outcome. The <acronymtitle="Software Development Kit">SDK</acronym> Palette contains code snippets to load materials. <br/>
3) If you don't know what an optional setting means, you're likely not using it.
</div></p>
</p>
</div>
<h3><a>Coloring and Standard Textures</a></h3>
<h2><a>Standard 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.
</p>
<div><table>
<tr>
<th> Material Definition </th><th> Usage </th><th> Parameter : Type </th>
<th>Basic Material Definition </th><th> Usage </th><th> Parameter : Type </th>
</tr>
<tr>
<td> Common/MatDefs/Misc/Unshaded.j3md </td><td> Standard unlit Material. Use this for simple coloring, simple texturing, simple glow, simple transparency. <br/>
<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: <ahref="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a></td><td> ColorMap : Texture <br/>
Other useful, but less commonly used material definitions:
</p>
<div><table>
<tr>
<th> Special Material Definitions </th><th> Usage </th><th> 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: <ahref="/com/jme3/gde/core/docs/jme3/advanced/sky.html">Sky</a></td><td> Texture : TextureCubeMap <br/>
@ -58,6 +82,29 @@ Texture2Scale : Float <br/>
Texture3 : Texture (blue) <br/>
Texture3Scale : Float <br/>
Alpha : Texture </td>
</tr>
<tr>
<td>Common/MatDefs/Terrain/HeightBasedTerrain.j3md</td><td>A multi-layered texture for terrains. <br/>
Specify four textures and a Vector3f describing the region in which each texture should appear: <br/>
X = start height, <br/>
Y = end height, <br/>
Z = texture scale. <br/>
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/>
<strong>Settings for steep areas:</strong><br/>
slopeColorMap : Texture2D <br/>
slopeTileFactor : Float</td>
</tr>
<tr>
<td> Common/MatDefs/Misc/Particle.j3md </td><td> Used with texture masks for particle effects, or for point sprites. <br/>
@ -70,25 +117,27 @@ Quadratic : Float <br/>
PointSprite : Boolean </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [1496-2939] -->
<p>
<br/>
<!-- EDIT2 TABLE [2407-4279] -->
</div>
<h2><a>Phong Illuminated</a></h2>
<div>
</p>
<p>
</div>
Illuminated materials require a <ahref="/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 <ahref="/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.
<h3><a>Light and Shadow</a></h3>
<div>
</p>
<div><table>
<tr>
<th> Material Definition</th><th> Usage </th><th> Parameters </th>
<th>Illuminated Material Definition </th><th> Usage </th><th> Parameters </th>
</tr>
<tr>
<td> Common/MatDefs/Light/Lighting.j3md </td><td> Standard lit 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). <br/>
<td> Common/MatDefs/Light/Lighting.j3md </td><td> Standard lit 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: <ahref="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a><br/>
<strong>Note:</strong> Lit materials require a <ahref="/com/jme3/gde/core/docs/jme3/advanced/light_and_shadow.html">light source</a>! Glowing materials require a <ahref="/com/jme3/gde/core/docs/jme3/advanced/bloom_and_glow.html">FilterPostProcessor</a>! </td><td> DiffuseMap : Texture <br/>
Glowing materials require a <ahref="/com/jme3/gde/core/docs/jme3/advanced/bloom_and_glow.html">FilterPostProcessor</a>! </td><td> DiffuseMap : Texture <br/>
<th>Special Illuminated Material Definitions </th><th> Usage </th><th> Parameters </th>
</tr>
<tr>
<td>Common/MatDefs/Terrain/TerrainLighting.j3md</td><td>Same kind of splat texture as Terrain.j3md, but with shading. <br/>
Requires a light source.</td><td>Color Diffuse : Color <br/>
<td>Common/MatDefs/Terrain/TerrainLighting.j3md</td><td>Same kind of multi-layered splat texture as Terrain.j3md, but with illumination and shading. <br/>
Typically used for terrains, but works on any mesh. <br/>
For every 3 splat textures, you need one alpha map. <br/>
You can use a total of 11 texture maps in the terrain'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/>
@ -138,6 +198,7 @@ NormalMap_2 : Texture <br/>
DiffuseMap_3 : Texture <br/>
DiffuseMap_3_scale : Float <br/>
NormalMap_3 : Texture <br/>
etc, up to 11. <br/>
<strong>Alpha Maps</strong><br/>
AlphaMap : Texture <br/>
AlphaMap_1 : Texture <br/>
@ -147,26 +208,25 @@ GlowMap : Texture <br/>
GlowColor : Color </td>
</tr>
<tr>
<td> Common/MatDefs/Light/Reflection.j3md </td><td> Reflective glass material with environment map (CubeMap/SphereMap). <br/>
Requires light source. <br/>
See also: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java"><paramname="text"value="<html><u>TestCubeMap.java</u></html>"><paramname="textColor"value="blue"></object></td><td> Texture : Texture <br/>
<td> Common/MatDefs/Light/Reflection.j3md </td><td> Reflective glass material with environment map (CubeMap/SphereMap). See also: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java"><paramname="text"value="<html><u>TestCubeMap.java</u></html>"><paramname="textColor"value="blue"></object></td><td> Texture : Texture <br/>
SphereMap: Boolean </td>
</tr>
</table></div>
<!-- EDIT2 TABLE [2970-5525] -->
<!-- EDIT4 TABLE [6104-7693] -->
<p>
<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>.
<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>
</p>
<p>
<strong>Bumpiness Tip:</strong> Before you can use NormalMaps, you must generate normals for the mesh (not the Geometry).
<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>
<td> Common/MatDefs/Misc/ShowNormals.j3md </td><td> A color gradient calculated from the model'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>
<!-- EDIT3 TABLE [5867-6152] -->
<p>
<br/>
<strong>Note:</strong> Common/MatDefs/Misc/SimpleTextured.j3md, ColoredTextured.j3md, VertexColor.j3md, Wireframe.j3md have been deprecated. Use equivalent features of Unshaded.j3md instead.
</p>
<!-- EDIT5 TABLE [8058-8343] -->
</div>
<h2><a>Transparency</a></h2>
<div>
<p>
Most Material Definitions support an alpha channel for transparency. In an RGBA color, the last float is the alpha channel: 0.0f is transparent, 1.0f is opaque. <br/>
For example: <code>mat.setColor("Color", new ColorRGBA(1,0,0,0.5f));</code> is a half-opaque red. <br/>
Most Material Definitions support an alpha channel for opaqueness and transparency in textures. In an RGBA color, the last float is the alpha channel: 0.0f is transparent and 1.0f is opaque. For example, <code>mat.setColor("Color", new ColorRGBA(1,0,0,0.5f));</code> is a half-opaque red.
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);</td><td>Use this for normal transparency. Interpolates the background pixel with the current by using the current pixel's alpha. E.g. alpha-blended vegetation. </td>
<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's alpha.</td><td>Hair texture, window panes, ice, glass, alpha-blended vegetation textures. </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 background pixel color with the current pixel color. E.g. particle effects that have black color as background. </td>
<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's depth value to the depth buffer.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);</td><td>Same as "Additive", except first it multiplies the current pixel color by the pixel alpha. E.g. used for particle effects that have alpha as background. </td>
mat.getAdditionalRenderState().setAlphaTest(true)</td><td>Enables alpha test. Works the same way as "AlphaDiscardThreshold".</td><td>Generally used for vegetation etc.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Color);</td><td>Blends by color. Generally useless.</td>
<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'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>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Modulate);</td><td>Multiplies the background pixel by the current pixel.</td>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);</td><td>Same as "Additive", 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.ModulateX2);</td><td>Same as "Modulate", except the result is doubled.</td>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Color);</td><td>Blends by color.</td><td>Generally useless.</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 "Alpha" blend mode. </td>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.Modulate);</td><td>Multiplies the background pixel by the current pixel.</td>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setDepthWrite(false);</td><td>Use this if you have several transparent objects obscuring one another. Disables writing of the pixel's depth value to the depth buffer. </td>
<td>mat.getAdditionalRenderState().setBlendMode(BlendMode.ModulateX2);</td><td>Same as "Modulate", except the result is doubled.</td>
mat.getAdditionalRenderState().setAlphaTest(true)</td><td>Enables alpha test, generally used for vegetation. Works the same way as "AlphaDiscardThreshold".</td>
<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 "Alpha" blend mode.</td><td>For use with premult alpha textures.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [6659-8462] -->
<!-- EDIT6 TABLE [8698-10778] -->
<p>
<br/>
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>
@ -245,17 +298,26 @@ Also note the AlphaDiscardThreshold value for materials based on Lighting.j3md.
<h2><a>Material Options</a></h2>
<div>
<div><table>
<tr>
<th>Material Option</th><th>Usage</th>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setWireframe(true);</td><td>Switch to showing the (textured) Material in wireframe mode</td>
mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack)</td><td>Activate back- or frontface culling, both (=invisible), or off. Backface culling is activated by default as an optimization.</td>
<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>
</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>
</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>
</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's other in-game properties, collision shapes, interactions, etc remain 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>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>
</tr>
<tr>
<td>mat.getAdditionalRenderState().setPointSprite(true);</td><td>Enables point-sprite mode, so meshes with "Mode.Points" 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>mat.getAdditionalRenderState().setPolyOffset();</td><td>Enable polygon offset. Use this when you have meshes that have triangles really close to each over (e.g. <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Coplanarity"><paramname="text"value="<html><u>Coplanar</u></html>"><paramname="textColor"value="blue"></object>), it will shift the depth values to prevent <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Z-fighting"><paramname="text"value="<html><u>Z-fighting</u></html>"><paramname="textColor"value="blue"></object>.</td>
</tr>
</table></div>
<!-- EDIT5 TABLE [8654-9943] -->
<!-- EDIT7 TABLE [10970-12683] -->
</div>
<div>
<div><sup><ahref="#fnt__1">1)</a></sup>
@ -276,4 +338,4 @@ Minnaert is a shader type.</div>
The game idea is based on “BattleZone” arcade game from the 1980s, a first-person shooter the with real-time strategy elements.
The game was written using the jMonkeyPlatform IDE, and it's based off the BasicGame project template. It took us one week to create a playable pre-alpha, including networking.
The project design follows best practices that make it possible to edit maps, vehicles, etc, in jMonkeyPlatform without having to change the code – This allows 3D graphic designers to contribute models more easily. (If you feel like contributing assets or working on parts of the game code, drop us a note!)
The game was written using the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, and it's based off the BasicGame project template. It took us one week to create a playable pre-alpha, including networking.
The project design follows best practices that make it possible to edit maps, vehicles, etc, in jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> without having to change the code – This allows 3D graphic designers to contribute models more easily. (If you feel like contributing assets or working on parts of the game code, drop us a note!)
</p>
@ -195,11 +195,11 @@ The sync manager basically puts a timestamp on every message sent from the serve
</div>
<h2><a>Use of jMonkeyPlatform tools</a></h2>
<h2><a>Use of jMonkeyEngine SDK tools</a></h2>
<div>
<p>
All assets used in the game, like entity models and loaded maps can be preconfigured and edited using jMonkeyPlatform. For example, to add a new vehicle type, a vehicle is created in the jMP vehicle editor and UserData like Speed, HitPoints etc. is applied directly in the editor. When the model is loaded in the game it is automatically configured based on these settings, the same accounts for maps that are loaded, special Nodes that mark e.g. player start locations are recognized automatically etc.
All assets used in the game, like entity models and loaded maps can be preconfigured and edited using the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>. For example, to add a new vehicle type, a vehicle is created in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> vehicle editor and UserData like Speed, HitPoints etc. is applied directly in the editor. When the model is loaded in the game it is automatically configured based on these settings, the same accounts for maps that are loaded, special Nodes that mark e.g. player start locations are recognized automatically etc.
</p>
@ -209,7 +209,7 @@ All assets used in the game, like entity models and loaded maps can be preconfig
<div>
<p>
Entities that are loaded from disk have certain UserData like HitPoints, Speed etc. that is used to configure the entity at runtime. jMP allows adding and editing this UserData so entity properties are editable visually.
Entities (Nodes and Geometries) that are loaded from disk have certain UserData like HitPoints, Speed etc. that is used to configure the entity at runtime. The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> allows adding and editing this UserData, so entity properties are editable visually.
</p>
@ -219,7 +219,7 @@ Entities that are loaded from disk have certain UserData like HitPoints, Speed e
<div>
<p>
VehicleControls, CharacterControls and RigidBodyControls with mesh collision shape for terrain and objects are generated in jMP and saved in the entity j3o file. When an entity is loaded, the type of entity is identified based on the available controls and UserData and it is configured accordingly.
VehicleControls, CharacterControls and RigidBodyControls with mesh collision shape for terrain and objects are generated in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> and saved in the entity j3o file. When an entity is loaded, the type of entity is identified based on the available controls and UserData and it is configured accordingly.
</p>
@ -307,10 +307,10 @@ Programmatic PlayerData:
<p>
Have a look at the code and feel free to ask about it, if you want any new features, you are free to implement them. ;)
MonkeyZone is hosted at GoogleCode, where you can check out the jMonkeyPlatform-ready project via svn:
MonkeyZone is hosted at GoogleCode, where you can check out the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>-ready project via svn:
<li><div> jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>→Team→Subversion→Checkout,</div>
</li>
<li><div> Enter the SVN <acronymtitle="Uniform Resource Locator">URL</acronym><code><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://monkeyzone.googlecode.com/svn/trunk/"><paramname="text"value="<html><u>http://monkeyzone.googlecode.com/svn/trunk/</u></html>"><paramname="textColor"value="blue"></object></code></div>
</li>
@ -328,4 +328,4 @@ MonkeyZone is hosted at GoogleCode, where you can check out the jMonkeyPlatform-
You can split the screen and look into the 3D scene from different camera angles at the same time. In this example, we create four views (2x2) with the same aspect ratio as the normal view, but half the size.
You can split the screen and look into the 3D scene from different camera angles at the same time.
</p>
<p>
@ -13,29 +13,99 @@ The packages used in this example are <code>com.jme3.renderer.Camera</code> and
</div>
<h2><a>Set up the First View</a></h2>
<h2><a>How to resize and Position ViewPorts</a></h2>
<div>
<p>
We use the preconfigured Camera <code>cam</code> and <code>viewPort</code> from <code>SimpleApplication</code> for the first view.
The default viewPort is as big as the window. If you have several, the must be of different sizes, either overlapping or adjacent to one another. How do you tell jME which of the ViewPorts should appear where on the screen, and how big it should be?
These viewport parameters are, (in this order) the left-right extend, and the bottom-top extend of a views's rectangle on the screen.
</p>
<pre>0.0 , 1.0 1.0 , 1.0
+-----+-----+
|cam1 |
| |
| +-----+
| | |
| |cam2 |
+-----+-----+
0.0 , 0.0 1.0 , 0.0</pre>
<p>
Example: Cam2's rectangle is int he bottom right: It extends from mid (x1=0.5f) bottom (y1=0.0f), to right (x2=1.0f) mid (y2=0.5f)
</p>
<p>
We will have a detailed look at how we use setViewPort() to position and resize the default view later.
<p><div>If you scale the views in a way so that the aspect ratio of a ViewPort is different than the window's aspect ratio, then the ViewPort appears distorted. In these cases, you must recreate (not clone) the ViewPort's cam object with the right aspect ratio. For example: <code>Camera cam5 = new Camera(100,100);</code>
</div></p>
</p>
</div>
<h2><a>Four-Time Split Screen</a></h2>
<div>
<p>
In this example, you create four views (2x2) with the same aspect ratio as the window, but each is only half the width and height.
</p>
</div>
<h2><a>Set up Three Additional Views</a></h2>
<h3><a>Set up the First View</a></h3>
<div>
<p>
You use the preconfigured Camera <code>cam</code> and <code>viewPort</code> from <code>SimpleApplication</code> for the first view. It's in the bottom right.
</p>
<pre>cam.setViewPort(.5f, 1f, 0f, 0.5f); // Resize the viewPort to half its size, bottom right.</pre>
<p>
Optionally, place the main camera in the scene and rotate it in its start position.
<h2><a>How to resize and position the ViewPorts</a></h2>
<div>
<p>
How does jme know which of the four views should appear where on the screen?
</p>
<p>
Imagine the view as a 1x1-sized box. By default, the settings is <code>cam.setViewPort(0f, 1f, 0f, 1f);</code>. This means the view takes up the whole box, from 0 to 1 left to right, and from 0 to 1 bottom to top.
To visualize what you do, use the following drawing of the viewport positions:
</p>
<pre>0.0 , 1.0 1.0 , 1.0
+-----+-----+
| | |
|cam3 |cam4 |
+-----------+
| | |
|cam2 |cam1 |
+-----+-----+
0.0 , 0.0 1.0 , 0.0</pre>
<p>
In the <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/renderer/TestMultiViews.java"><paramname="text"value="<html><u>code sample</u></html>"><paramname="textColor"value="blue"></object>, note the following four lines:
This are the lines of code that set the four cameras to create a four-times split screen.
These viewport parameters are, in this order, the left - right - bottom - top extend of a camera's box on the screen. Note that we have set a few values to 0.5f – this is where we resize each view to half its default height and width.
</p>
<pre>0.0 , 1.0 1.0 , 1.0
+----+----+
| | |
|cam3|cam4|
+---------+
| | |
|cam2|cam |
+----+----+
0.0 , 0.0 1.0 , 0.0</pre>
</div>
<h2><a>Picture in Picture</a></h2>
<div>
<p>
Example: Cam3's rect extends from bottom-left (0.0 , 0.5) to top-right (0.5 , 1.0)
The following code snippet sets up two views, one covers the whole screen, and the second is a small view in the top center.
</p>
<ul>
<li><div> The left corner is at 0, and the right corner is 0.5 on the x axis. </div>
</li>
<li><div> The bottom of the box is at 0.5 and the top at 1.0 on the y axis.</div>
If you scale the views in a way so that the aspect ratio changes, the views will obviously be distorted. In these cases, create custom camera objects with the right aspect ratio (redefine the default cam).
… or you can give each camera a special node whose content it can see:
@ -434,6 +434,16 @@ You cannot modify the scenegraph in the NetworkThread. You have to create a Call
Learn more about <ahref="/com/jme3/gde/core/docs/jme3/advanced/multithreading.html">multithreading</a> here.
</p>
</div>
<h2><a>Troubleshooting</a></h2>
<div>
<p>
If you have set up a server in your home network, and the game clients cannot reach it from the outside, it's time to learn about <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://portforward.com/"><paramname="text"value="<html><u>port forwarding</u></html>"><paramname="textColor"value="blue"></object>.
@ -208,7 +208,7 @@ The startGame() example simply switches the <acronym title="Graphical User Inter
</p>
<p>
The quitGame() example shows that you have access to the application <code>app</code> object because you made the ScreenController extend AbstractAppState.
The quitGame() example shows that you have access to the application <code>app</code> object because you made the ScreenController extend AbstractAppState. (If you're creating code from this example, note that you'll need to make sure <code>app</code> is initialized before you can successfully call its methods.)
</p>
</div>
@ -313,4 +313,4 @@ You're done with the basic Nifty <acronym title="Graphical User Interface">
The full demo ZIP is based on <code>de.lessvoid.nifty.examples.controls.ControlsDemo.java</code>.</div>
<ol>
<li><div> The demo is a SimpleApplication-based game (use e.g. the BasicGame template in the jMonkeyPlatform).</div>
<li><div> The demo is a SimpleApplication-based game (use e.g. the BasicGame template in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>).</div>
</li>
<li><div> Copy images and sound files into your project's <code>assets/Interface/</code> directory. (In this example, I copied them from <code>nifty-default-controls-examples/trunk/src/main/resources/</code> to <code>assets/Interface/</code>).</div>
</li>
@ -606,7 +606,7 @@ Before initializing the nifty screens, you set up properties and register media.
<td> setDebugOptionPanelColors(true);</td><td> Highlight all panels, makes it easier to arrange them. </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [17259-17582] -->
<!-- EDIT1 TABLE [17261-17584] -->
<p>
Example:
@ -636,4 +636,4 @@ Integrate the <acronym title="Graphical User Interface">GUI</acronym> into the g
In order to make the hud-frame.png independent of the screen resolution you are using, you could use the <code>imageMode</code> attribute on the image element <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Resizable_Images_(ImageMode%3Dresize)_explained"><paramname="text"value="<html><u> Resizable Images (ImageMode=resize) explained</u></html>"><paramname="textColor"value="blue"></object>
@ -9,7 +9,8 @@ Creating an effect involves some trial and error to get the settings <em>just ri
</p>
<p>
<strong>Tip:</strong> Use the Scene Editor in the <ahref="/com/jme3/gde/core/docs/sdk.html">jMonkeyPlatform</a> to design and preview effects.
<p><div>Use the <ahref="/com/jme3/gde/core/docs/sdk/scene_explorer.html">Scene Explorer</a> in the <ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> to design and preview effects.
</div></p>
</p>
<p>
@ -114,7 +115,7 @@ false = Particles fly straight like you drew them in the sprite texture (e.g. in
<td> start area </td><td><code>setShape(new EmitterSphereShape( Vector3f.ZERO, 2f));</code></td><td>EmitterPointShape()</td><td>By default, particles are emitted from the emitters location (a point). You can increase the emitter shape to occupy a sphere, so that the start point of new particles can be anywhere inside the sphere, which makes the effect a bit more irregular.</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [1635-5409] -->
<!-- EDIT1 TABLE [1638-5412] -->
<p>
Build up you effect by specifying one parameter after the other. If you change several parameters at the same time, it's difficult to tell which of the values caused which outcome.
</p>
@ -194,7 +195,7 @@ The following effect textures are available by default from <code>test-data.jar<
<strong>Tip:</strong> Use the <code>setStartColor()</code>/<code>setEndColor()</code> settings described above to colorize the white and gray parts of textures.
@ -233,4 +234,4 @@ See also: <a href="/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html">
You can save and load scenes and individual Nodes using com.jme3.export.binary.BinaryExporter and com.jme3.export.binary.BinaryImporter. Use standard Java serialization to load game data. The jMonkeyEngine binary file format is .j3o. You can open, view, and edit .j3o files in the jMonkeyPlatform.
You can save and load scenes and individual Nodes using com.jme3.export.binary.BinaryExporter and com.jme3.export.binary.BinaryImporter. Use standard Java serialization to load game data. The jMonkeyEngine binary file format is .j3o. You can open, view, and edit .j3o files in the jMonkeyEngine <ahref="/com/jme3/gde/core/docs/jme3/advanced/sdk.html">SDK</a>.
<th> Examples: </th><td>A box, a sphere, player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc… </td><td> The rootNode, the guiNode, an audio node, a custom grouping node, etc… </td>
<th> Examples: </th><td>Box, sphere, player, building, terrain, vehicle, missiles, NPCs, etc… </td><td> The rootNode, the guiNode, an audio node, a custom grouping node, etc… </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [944-2177] -->
<!-- EDIT1 TABLE [944-2158] -->
<p>
<p><div>You never create a Spatial with <code>Spatial s = new Spatial();</code>! A Spatial is an abstract concept, like a mammal (there is no actual creature called "mammal" walking around here). You create a Node, or load a Geometry object. Some methods however require a Spatial argement: This is because they are able to accept both Nodes and Geometries as arguments. In this case, you must cast a Node or Geometry to Spatial.
@ -79,34 +79,56 @@ The polygon <a href="/com/jme3/gde/core/docs/jme3/advanced/mesh.html">Mesh</a> i
</div>
<h2><a>How to Add User Data to a Spatial</a></h2>
<h2><a>How to Add Fields and Methods to a Spatial</a></h2>
<div>
<p>
You can include custom Java objects in Nodes and Geometries. This is useful for maintaining information about a game element, such as health, budget, ammunition, inventory, equipment, etc for players, or landmark locations for terrains, and much more. Where ever the spatial is accessible, you can also access the object's game data.
You can include custom Java objects in Nodes and Geometries. This is useful for maintaining information about a game element, such as health, budget, ammunition, inventory, equipment, etc for players, or landmark locations for terrains, and much more.
</p>
<pre>// create and instance of your custom data class
PlayerData playerData = new PlayerData("joe", 0, 100);
You do not need to create a custom class that extends Node or Geometry to be able to add custom fields to a spatial – use the setUserData() method instead. Neither do need to create a custom class that extends Node to be able to add custom accessor methods to this spatial – use a Control instead. Where ever the spatial is accessible, you can also access the object's game data and accessors.
</p>
<p>
For example when you initialize your custom PlayerControl class:
</p>
<pre>// init custom data fields in this Control's Spatial (Node or Geometry)
You can add as many data objects to a Spatial as you need. Just make sure to label them with different Strings (<code>player data</code>, <code>player inventory</code>, <code>player equipment</code>, etc).
You can add as many data objects (including Strings, Integers, Floats, Arrays,) to a Spatial as you need. Just make sure to label them with different Strings (<code>health</code>, <code>inventory</code>, <code>equipment</code>, etc). The saved data can also be custom Java objects if you make the Java class implement the Savable interface. When you save a Spatial as a j3o file, the custom data is saved too, and it will be restored the next time you load the j3o!
</p>
<p>
You can also list all data keys that are defined for one Spatial:
You can list all data keys that are already defined for one Spatial:
@ -120,7 +142,7 @@ Often after you load a scene or model, you need to access a part of it as an ind
</p>
<ol>
<li><div> Open the model in a 3D mesh editor, or in the jMonkeyPlatform's viewer. </div>
<li><div> Open the model in a 3D mesh editor, or in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>'s Scene Composer. </div>
</li>
<li><div> Find out the existing names of sub-meshes in the model.</div>
</li>
@ -135,4 +157,4 @@ In the following example, the Node <code>house</code> is the loaded model. The s
<h1><a>TerraMonkey - The jMonkeyEngine Terrain System</a></h1>
<div>
<p>
The goal of TerraMonkey is to provide a base implementation that will be usable for 80% of people's goals, while providing tools and a good foundation for the other 20% to build off of. Check out the videos in the following announcements:
</p>
<ul>
@ -18,6 +19,7 @@ The goal of TerraMonkey is to provide a base implementation that will be usable
<div>
<p>
TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real time editing and texture splatting. That's a mouth full! Lets look at each part:
</p>
<ul>
@ -27,37 +29,52 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
</li>
<li><div><strong>Splatting:</strong> The ability to paint multiple textures onto your terrain. What differs here from JME2 is that this is all done in a shader, no more render passes. So it performs much faster.</div>
</li>
<li><div><strong>Real-time editing:</strong> TerraMonkey will be editable in JMonkeyPlatform, and you will be able to do it in real time: raising and lowering terrain.</div>
<li><div><strong>Real-time editing:</strong> TerraMonkey terrains are editable in jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, and you are able to modify them in real time: raising and lowering terrain.</div>
</li>
</ul>
</div>
<h2><a>Current Features:</a></h2>
<h3><a>Current Features:</a></h3>
<div>
<ul>
<li><div> Support for up to 3 splat textures.</div>
<li><div> Support for 16 splat textures. You use a custom combination of Diffuse, Normal, Specular, and Glow Maps.</div>
</li>
<li><div> GeoMipMapping: LodControl optimizes the level of detail</div>
</li>
<li><div> GeoMipMapping</div>
<li><div>Terrain can be randomized or generated from a heightmap</div>
</li>
<li><div> can be supplied a heightmap</div>
<li><div> jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> terrain editor</div>
@ -67,14 +84,16 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
<div>
<p>
You have seen GeoMipMapping implemented in games before. This is where the farther away terrain has fewer polygons, and as you move closer, more polygons fill in. The whole terrain is divided into a grid of patches, and each one has its own LOD. The GeoMipMapping algorithm will look at each patch, and its neighbours, to determine how to render the geometry. It will seam the edges between two patches with different LOD.
This often leads to "popping" where you see the terrain switch from one LOD to another. TerraMonkey has been designed so you can swap out different LOD calculation algorithms based on what will look best for your game.
You can do this with the LodCalculator interface.
GeoMipMapping in TerraMonkey has been split into several parts: the terrain quad tree, and the LODGeomap. The geomap deals with the actual LOD and seaming algorithm. So if you want a different data structure for your terrain system, you can re-use this piece of code.
The quad tree (TerrainQuad and TerrainPatch) provide a means to organize the LODGeomaps, notify them of their neighbour's LOD change, and to update the geometry when the LOD does change.
To change the LOD it does this by changing the index buffer of the triangle strip, so the whole geometry doesn't have to be re-loaded onto the video card.
If you are eager, you can read up more detail how GeoMipMapping works here: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://www.flipcode.com/archives/article_geomipmaps.pdf"><paramname="text"value="<html><u>www.flipcode.com/archives/article_geomipmaps.pdf</u></html>"><paramname="textColor"value="blue"></object>
You have seen GeoMipMapping implemented in games before. This is where the farther away terrain has fewer polygons, and as you move closer, more polygons fill in. The whole terrain is divided into a grid of patches, and each one has its own level of detail (LOD). The GeoMipMapping algorithm looks at each patch, and its neighbours, to determine how to render the geometry. It will seam the edges between two patches with different LOD.
</p>
<p>
GeoMipMapping often leads to "popping" where you see the terrain switch from one LOD to another. TerraMonkey has been designed so you can swap out different LOD calculation algorithms based on what will look best for your game. You can do this with the LodCalculator interface.
</p>
<p>
GeoMipMapping in TerraMonkey has been split into several parts: the terrain quad tree, and the LODGeomap. The geomap deals with the actual LOD and seaming algorithm. So if you want a different data structure for your terrain system, you can re-use this piece of code. The quad tree (TerrainQuad and TerrainPatch) provide a means to organize the LODGeomaps, notify them of their neighbour's LOD change, and to update the geometry when the LOD does change. To change the LOD it does this by changing the index buffer of the triangle strip, so the whole geometry doesn't have to be re-loaded onto the video card. If you are eager, you can read up more detail how GeoMipMapping works here: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://www.flipcode.com/archives/article_geomipmaps.pdf"><paramname="text"value="<html><u>www.flipcode.com/archives/article_geomipmaps.pdf</u></html>"><paramname="textColor"value="blue"></object>
</p>
</div>
@ -83,8 +102,8 @@ If you are eager, you can read up more detail how GeoMipMapping works here: <obj
<div>
<p>
TerraMonkey is a quad tree. Each node is a TerrainQuad, and each leaf is a TerrainPatch. A TerrainQuad has either 4 child TerrainQuads, or 4 child TerrainPatches. The TerrainPatch holds the actual mesh geometry. This structure is almost exactly the same as JME2's TerrainPage system. Except now each leaf has a reference to its neighbours, so it doesn't ever have to traverse the tree to get them.
TerraMonkey is a quad tree. Each node is a TerrainQuad, and each leaf is a TerrainPatch. A TerrainQuad has either 4 child TerrainQuads, or 4 child TerrainPatches. The TerrainPatch holds the actual mesh geometry. This structure is almost exactly the same as JME2's TerrainPage system. Except now each leaf has a reference to its neighbours, so it doesn't ever have to traverse the tree to get them.
</p>
</div>
@ -93,22 +112,122 @@ TerraMonkey is a quad tree. Each node is a TerrainQuad, and each leaf is a Terra
<div>
<p>
The default material for TerraMonkey is Terrain.j3md. This material combines an alphamap with several textures to produce the final texture.
Right now there is support for only 3 textures and an alpha map. This is in place until we finish the terrain editor in JMP, and then the texture support will be 16 textures.
It is only 3 right now so you can hand-paint them in a drawing program, like Photoshop, setting each splat texture in either Red, Green, or Blue. The test case has an example texture to show you how this works.
Along with getting more splat texture support, we will be adding in lighting and normal mapping support. The normal mapping isn't fully planned out yet. We need to decide how we are going to handle a normal map for each texture that is passed in. That could generate some very odd effects.
Thoughts, ideas, and recommendations are appreciated!
We recommend to <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/wiki/doku.php/sdk:terrain_editor"><paramname="text"value="<html><u>create and edit Splat Textures for terrains visually in the jMonkeyEngine SDK</u></html>"><paramname="textColor"value="blue"></object>. If you are curious or want to create materials manually, read on for the implementation details:
</p>
<p>
When you "slap" a texture on a mesh, the whole mesh looks the same. For big meshes (such as terrains) that is undesirable because it looks very boring (your whole landscape would be all rock, or all grass, or all sand). Texture Splatting is a technique that lets you "paint" several textures into one combined texure. Each of the splat textures has an opacity value so you can define where it is visible in the final overall texture.
</p>
<p>
The default material for TerraMonkey is TerrainLighting.j3md. This material combines several texture maps to produce the final custom texture. Remember, Diffuse Maps are the main textures that define the look; optionally, each Diffuse Map can be enhanced with a Normal Map; Alpha Maps describe the opacity of each Diffuse Map used (one color –red, green, blue, or alpha– stands for one Diffuse Map's opacity); Glow and Specular Maps define optional effects. Here are the names of the material properties:
</p>
<ul>
<li><div> 1-3 Alpha Maps</div>
<ul>
<li><div><code>AlphaMap</code></div>
</li>
<li><div><code>AlphaMap_1</code></div>
</li>
<li><div><code>AlphaMap_2</code></div>
</li>
</ul>
</li>
<li><div> 12 Diffuse and/or Normal Maps (either in pairs, or stand-alone Diffuse Maps)</div>
<ul>
<li><div><code>DiffuseMap</code></div>
</li>
<li><div><code>NormalMap</code></div>
</li>
<li><div><code>DiffuseMap_1</code></div>
</li>
<li><div><code>NormalMap_1</code></div>
</li>
<li><div><code>DiffuseMap_2</code></div>
</li>
<li><div><code>NormalMap_2</code></div>
</li>
<li><div> etc, up to <code>…Map_11</code>.</div>
</li>
</ul>
</li>
<li><div>"Light" maps</div>
<ul>
<li><div><code>GlowMap</code></div>
</li>
<li><div><code>SpecularMap</code></div>
</li>
</ul>
</li>
</ul>
<p>
Video cards support a maximum of 16 Splat textures total. This means you can only use a subset of material properties at the same time! Follow these constraints:
</p>
<ul>
<li><div> 1-12 Diffuse Maps</div>
</li>
<li><div> 1-3 Alpha Maps (for each 4 Diffuse Maps, you need 1 more Alpha Map!)</div>
</li>
<li><div> 0-6 Normal Maps (number must be equal or less than number of Diffuse Maps, since they come in pairs!)</div>
</li>
<li><div> 0 or 1 Glow Map</div>
</li>
<li><div> 0 or 1 Specular Map.</div>
</li>
<li><div> The sum of all maps used must be 16 or less.</div>
You can hand-paint Alpha, Diffuse, Glow, and Specular maps in a drawing program, like Photoshop. Define each splat texture in the Alpha Map in either Red, Green, Blue, or Alpha (=RGBA). The JmeTests project bundled in the <ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> includes some image files that show you how this works. The following images show the terrains heightmap next to its Alpha Map (ready for 3 Diffuse Maps) and one exemplary Diffuse/Normal Map pair.
</p>
<p>
<imgsrc="/wiki/lib/exe/fetch.php">
<imgsrc="/wiki/lib/exe/fetch.php">
<imgsrc="/wiki/lib/exe/fetch.php">
<imgsrc="/wiki/lib/exe/fetch.php">
</p>
</div>
<h2><a>Code Sample</a></h2>
<h2><a>Code Sample: Terrain.j3md</a></h2>
<div>
<p>
First, we load our textures and the heightmap texture for the terrain
This example shows the simpler material definition <code>Terrain.j3md</code>, which only supports 1 Alpha Map, 3 Diffuse Maps, 3 Normal Maps, and does not support Phong illumination. It makes the exmaple shorter – TerrainLighting.j3md works accordingly (The list of material properties see above. Links to extended sample code see above.)
</p>
<p>
First, we load our textures and the heightmap texture for the terrain
</p>
<pre>// Create material from Terrain Material Definition
matRock = new Material(assetManager, "Common/MatDefs/Terrain/Terrain.j3md");
In the <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestQ3.java"><paramname="text"value="<html><u>TestQ3.java</u></html>"><paramname="textColor"value="blue"></object> code sample you have seen how to create collidable landscapes and walk around in a first-person perspective, where the camera is enclosed by a collision shape. Other games however require a third-person perspective of the character: In these cases you use a CharacterControl. This example uses a custom navigation – press WASD to walk and drag the mouse to rotate.
In the <ahref="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Hello Collision</a> tutorial and the <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestQ3.java"><paramname="text"value="<html><u>TestQ3.java</u></html>"><paramname="textColor"value="blue"></object> code sample you have seen how to create collidable landscapes and walk around in a first-person perspective. The first-person camera is enclosed by a collision shape and is steered by a CharacterControl.
</p>
<p>
Other games however require a third-person perspective of the character: In these cases you use a CharacterControl on a Spatial. This example also shows how to set up custom navigation constrols, so you can press WASD to make the third-person character walk, and drag the mouse to rotate.
</p>
@ -32,10 +36,13 @@ The several related code samples can be found here:
Mobile deployment is a "one-click" option next to Desktop/WebStart/Applet deployment in the jMonkeyPlatform.
Mobile deployment is a "one-click" option next to Desktop/WebStart/Applet deployment in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
</p>
<ul>
<li><div> Automatic creation of Android harness and settings.</div>
@ -89,9 +89,9 @@ Mobile deployment is a "one-click" option next to Desktop/WebStart/App
<h2><a>Beta Instructions</a></h2>
<div>
<ol>
<li><div> Make sure you have installed the Android Project Support into the jMonkeyPlatform.</div>
<li><div> Make sure you have installed the Android Project Support into the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.</div>
</li>
<li><div> Open the jMonkeyPlatform Options>Mobile and enter the path to your Android <acronymtitle="Software Development Kit">SDK</acronym> directory, and click OK. E.g. <code>/opt/android-sdk</code></div>
<li><div> Open the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> Options>Mobile and enter the path to your Android <acronymtitle="Software Development Kit">SDK</acronym> directory, and click OK. E.g. <code>/opt/android-sdk</code></div>
</li>
</ol>
@ -124,7 +124,7 @@ The Android deployment option creates a separate sub-project for android and mak
</p>
<p>
Activating the nbandroid plugin in the jMonkeyPlatform is optional, but recommended. You do not need the nbandroid plugin for Android support to work, however nbandroid will not interfere and will in fact allow you to edit the android source files and project more conveniently. To be able to edit, extend and code android-specific code in Android projects, install NBAndroid from the update center:
Activating the nbandroid plugin in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> is optional, but recommended. You do not need the nbandroid plugin for Android support to work, however nbandroid will not interfere and will in fact allow you to edit the android source files and project more conveniently. To be able to edit, extend and code android-specific code in Android projects, install NBAndroid from the update center:
</p>
<ol>
<li><div> Open Tools→Plugins→Settings</div>
@ -137,7 +137,7 @@ Activating the nbandroid plugin in the jMonkeyPlatform is optional, but recommen
<p>
Restart the jMonkeyPlatform.
Restart the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
</p>
</div>
@ -147,7 +147,7 @@ Restart the jMonkeyPlatform.
<p>
Open your game project in the jMonkeyPlatform.
Open your game project in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
</p>
<ol>
<li><div> Right-click the project node and choose Set Main Project.</div>
You can use the jMonkeyPlatform to save (theoretically) any jMonkeyEngine app as Android app. But the application has to be prepared for the fact that Android devices have a smaller screen resolution, touchscreens instead of mouse buttons, and (typically) no keyboards.
You can use the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> to save (theoretically) any jMonkeyEngine app as Android app. But the application has to be prepared for the fact that Android devices have a smaller screen resolution, touchscreens instead of mouse buttons, and (typically) no keyboards.
</p>
<ul>
<li><div><strong>Inputs:</strong> Devise an alternate control scheme that works for Android users (e.g. using com.jme3.input.controls.TouchListener). This mobile scheme is likely quite different from the desktop scheme.</div>
</li>
<li><div><strong>Effects:</strong> Android devices do no support 3D features as well as PCs – or even not at all. E.g. post-processor filters (depth-of-field blur, bloom, light scattering, cartoon, etc), drop shadows, water effects, 3D Audio. Be prepared that these effects will (at best) slow down the application or (in the worst case) not work at all. Provide the option to switch to a low-fi equivalent! </div>
<li><div><strong>Effects:</strong> Android devices do no support 3D features as well as PCs – or even not at all. This restriction includes post-processor filters (depth-of-field blur, bloom, light scattering, cartoon, etc), drop shadows, water effects, 3D Audio. Be prepared that these effects will (at best) slow down the application or (in the worst case) not work at all. Provide the option to switch to a low-fi equivalent! </div>
</li>
<li><div><strong>Nifty <acronymtitle="Graphical User Interface">GUI</acronym>:</strong> Use different base UI layout <acronymtitle="Extensible Markup Language">XML</acronym> files for the mobile version of your app to account for the different screen settings.</div>
<li><div><strong>Nifty <acronymtitle="Graphical User Interface">GUI</acronym>:</strong> Use different base UI layout <acronymtitle="Extensible Markup Language">XML</acronym> files for the mobile version of your app to account for a different screen resolution.</div>
</li>
</ul>
@ -247,4 +247,4 @@ The <acronym title="Software Development Kit">SDK</acronym> will later provide t
@ -17,7 +17,7 @@ In this tutorial we will learn to load 3-D models and text into the scene graph,
</p>
<p>
<p><div>To use the example assets in a new jMonkeyPlatform project, right-click your project, select "Properties", go to "Libraries", press "Add Library" and add the "jme3-test-data" library.
<p><div>To use the example assets in a new jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> project, right-click your project, select "Properties", go to "Libraries", press "Add Library" and add the "jme3-test-data" library.
To create 3D models and scenes, you need a 3D Mesh Editor with an OgreXML Exporter plugin. For example, you can <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics"><paramname="text"value="<html><u>create fully textured models with Blender</u></html>"><paramname="textColor"value="blue"></object>.
You use the <ahref="/com/jme3/gde/core/docs/sdk.html">jMonkeyPlatform</a> to <ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">load models</a>, <ahref="/com/jme3/gde/core/docs/sdk/blender.html">convert models</a> and <ahref="/com/jme3/gde/core/docs/sdk/scene_composer.html">create scenes</a> from them.
You use the <ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> to <ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">load models</a>, <ahref="/com/jme3/gde/core/docs/sdk/blender.html">convert models</a> and <ahref="/com/jme3/gde/core/docs/sdk/scene_composer.html">create scenes</a> from them.
</p>
<p>
@ -278,7 +278,7 @@ If you use Blender, export your models as Ogre <acronym title="Extensible Markup
<p>
JME3 can load Ogre <acronymtitle="Extensible Markup Language">XML</acronym> models + materials, Ogre DotScenes, as well as Wavefront OBJ+MTL models. The loadModel() code works with these files when you run the code directly from the jMonkeyPlatform.
JME3 can load Ogre <acronymtitle="Extensible Markup Language">XML</acronym> models + materials, Ogre DotScenes, as well as Wavefront OBJ+MTL models. The loadModel() code works with these files when you run the code directly from the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
For testing and for the final release build, you use .j3o files exclusively. J3o is an optimized binary format for jME3 applications, and .j3o files are automatically included in the distributable JAR file by the build script. When you do QA test builds or are ready to release, use the <ahref="/com/jme3/gde/core/docs/sdk.html">jMonkeyPlatform</a> to <ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">convert</a> all .obj/.scene/.xml/.blend files to .j3o files, and only load the .j3o versions.
For testing and for the final release build, you use .j3o files exclusively. J3o is an optimized binary format for jME3 applications, and .j3o files are automatically included in the distributable JAR file by the build script. When you do QA test builds or are ready to release, use the <ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> to <ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">convert</a> all .obj/.scene/.xml/.blend files to .j3o files, and only load the .j3o versions.
</p>
<p>
Open your JME3 Project in the jMonkeyplatform.
Open your JME3 Project in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
</p>
<ol>
<li><div> Right-click a .Blend, .OBJ, or .mesh.xml file in the Projects window, and choose "convert to JME3 binary". </div>
@ -431,7 +431,7 @@ Here is a third method you must know, loading a scene/model from a .j3o file:
<ol>
<li><div> Remove the code from the previous exercise.</div>
</li>
<li><div> If you haven't already, open the <ahref="/com/jme3/gde/core/docs/sdk.html">jMonkeyPlatform</a> and open the project that contains the HelloAsset class.</div>
<li><div> If you haven't already, open the <ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> and open the project that contains the HelloAsset class.</div>
</li>
<li><div> In the projects window, browse to the <code>assets/Scenes/town</code> directory. </div>
</li>
@ -497,4 +497,4 @@ Let's add some action to the scene and continue with the <a href="/com/jme3
@ -326,7 +326,7 @@ Add and modify one parameter at a time, and try different values until you get t
</p>
<p>
<p><div><strong>Tip:</strong> Use the jMonkeyPlatform SceneComposer to create effects more easily. Create an empty scene and add an emitter object to it. Change the emitter properties and watch the outcome live. You can save created effects as .j3o file and load them like scenes or models.
<p><div><strong>Tip:</strong> Use the SceneComposer in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> to create effects more easily. Create an empty scene and add an emitter object to it. Change the emitter properties and watch the outcome live. You can save created effects as .j3o file and load them like scenes or models.
</div></p>
</p>
@ -374,4 +374,4 @@ Now you move on to another exciting chapter – the simulation of <object classi
@ -180,8 +180,12 @@ The next thing the game needs is some <em>inter</em>action! Continue learning ho
<hr/>
<p>
See also: Advanced jME3 developers additionally use <ahref="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> and <ahref="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html">Custom Controls</a> to implement more complex mechanics in their game loops. You will come across these topics later when you proceed to advanced documentation.
See also:
</p>
<ul>
<li><div> Advanced jME3 developers use <ahref="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> and <ahref="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html">Custom Controls</a> to implement game mechanics in their update loops. You will come across these topics again later when you proceed to more advanced documentation.</div>
@ -332,7 +332,7 @@ You create a j3m file as follows:
<li><div> Create a file <code>assets/Materials/LeakThrough.j3m</code> with the following content:<pre>Material Leak Through : Common/MatDefs/Misc/Unshaded.j3md {
MaterialParameters {
Color : 1 0 1 1
ColorMap : Textures/ColoredTex/Monkey.png
ColorMap : Flip Textures/ColoredTex/Monkey.png
}
}</pre>
</div>
@ -347,7 +347,7 @@ You create a j3m file as follows:
</li>
<li><div> In the code sample, comment out the three lines with <code>mat_tl</code> in them.</div>
</li>
<li><div> Below them, add the following line: <pre>cube_leak.setMaterial((Material) assetManager.loadAsset("Materials/LeakThrough.j3m"));</pre>
<li><div> Below them, add the following line: <pre>cube_leak.setMaterial((Material) assetManager.loadMaterial("Materials/LeakThrough.j3m"));</pre>
</div>
</li>
<li><div> Run the app. The result is the same.</div>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://www.youtube.com/watch?v=Feu3-mrpolc"><paramname="text"value="<html><u>Video Tutorial: Editing and Assigning Materials to Models in jMonkeyPlatform</u></html>"><paramname="textColor"value="blue"></object></div>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://www.youtube.com/watch?v=Feu3-mrpolc"><paramname="text"value="<html><u>Video Tutorial: Editing and Assigning Materials to Models in jMonkeyEngine SDK</u></html>"><paramname="textColor"value="blue"></object></div>
</li>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://www.blender.org/education-help/tutorials/materials/"><paramname="text"value="<html><u>Creating textures in Blender</u></html>"><paramname="textColor"value="blue"></object></div>
You will learn that the scene graph represents the 3D world, and why the rootNode is important. You will learn how to create simple objects, and how to "transform" them by moving, scaling, and rotating. You will understand the difference between the two types of "Spatials" in the scene graph: Nodes and Geometries.
You will learn that the scene graph represents the 3D world, and why the rootNode is important. You will learn how to create simple objects, how to let them carry custom data (such as health points), and how to "transform" them by moving, scaling, and rotating. You will understand the difference between the two types of "Spatials" in the scene graph: Nodes and Geometries.
</p>
</div>
@ -122,7 +122,7 @@ In this tutorial, you learn some new terms:
<td>Make an object disappear from the scene</td><td>Detach the Spatial from the rootNode</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [3020-3312] -->
<!-- EDIT1 TABLE [3079-3371] -->
<p>
Every JME3 application has a rootNode: Your game automatically inherits the <code>rootNode</code> object from SimpleApplication. Everything attached to the rootNode is part of the scene graph. The elements of the scene graph are Spatials.
@ -149,7 +149,7 @@ Every JME3 application has a rootNode: Your game automatically inherits the <cod
<th> Examples: </th><td> A box, a sphere, a player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc… </td><td> The <code>rootNode</code>, a floor node grouping several terrains, a custom vehicle-with-passengers node, a player-with-weapon node, an audio node, etc… </td>
<td> Specify what should be loaded at the start </td><td> Everything you initialize and attach to the <code>rootNode</code> in the <code>simpleInitApp()</code> method is part of the scene at the start of the game. </td>
</tr>
</table></div>
<!-- EDIT3 TABLE [7021-8142] -->
<!-- EDIT3 TABLE [7080-8201] -->
</div>
<h2><a>How do I Transform Spatials?</a></h2>
@ -301,7 +301,7 @@ To move a Spatial <em>to</em> specific coordinates, such as (0,40.2f,-2), use: <
@ -329,7 +329,7 @@ To roll an object 180° around the z axis: <pre>thing.rotate( 0f , 0f , 180*
</td><td>pitch = nodding your head</td><td>yaw = shaking your head</td><td>roll = cocking your head</td>
</tr>
</table></div>
<!-- EDIT6 TABLE [9276-10057] -->
<!-- EDIT6 TABLE [9335-10116] -->
</div>
<h2><a>How do I Troubleshoot Spatials?</a></h2>
@ -360,7 +360,40 @@ Did you rotate around the right axis? </td>
<td> A Geometry has an unexpected Color or Material. </td><td> Did you reuse a Material from another Geometry and have inadvertently changed its properties? (If so, consider cloning it: mat2 = mat.clone(); ) </td>
</tr>
</table></div>
<!-- EDIT7 TABLE [10190-11163] -->
<!-- EDIT7 TABLE [10249-11222] -->
</div>
<h2><a>How do I Add Custom Data to Spatials?</a></h2>
<div>
<p>
Many Spatials represent game characters or other entities that the player can interact with. The above code that rotates the two boxes around a common center (pivot) could be used for a spacecraft docked to a orbiting space station, for example.
</p>
<p>
Depending on your game, game entities do not only change their position, rotation, or scale (the transformations that you just learned about). Game entities also have custom properties, such as health, inventory carried, equipment worn for a character, or hull strength and fuel left for a spacecraft. In Java, you represent entity data as class variables, e.g. floats, Strings, or Arrays.
</p>
<p>
You can add custom data directly to any Node or Geometry. <strong>You do not need to extend the Node class to include variables</strong>!
For example, to add a custom id number to a node, you would use:
To read this Node's id number elsewhere, you would use:
</p>
<pre>int id = pivot.getUserData("pivot id"); </pre>
<p>
By using different Strings keys (here the key is <code>pivot id</code>), you can get and set several values for whatever data the Spatial needs to carry. When you start writing your game, you might add a fuel value to a car node, speed value to an airplane node, or number of gold coins to a player node, and much more.
</p>
</div>
<h2><a>Conclusion</a></h2>
@ -368,11 +401,11 @@ Did you rotate around the right axis? </td>
<p>
You have learned that your 3D scene is a scene graph made up of Spatials: Visible Geometries and invisible Nodes. You can transform Spatials, or attach them to nodes and transform the nodes.
You have learned that your 3D scene is a scene graph made up of Spatials: Visible Geometries and invisible Nodes. You can transform Spatials, or attach them to nodes and transform the nodes. You know the easiest way how to add custom entity properties (such as player health or vehicle speed) to Spatials.
</p>
<p>
Since standard shapes like spheres and boxes get old fast, continue with the next chapter where you learn to <ahref="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">load assets, such as 3-D models</a>.
Since standard shapes like spheres and boxes get old fast, continue with the next chapter where you learn to <ahref="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">load assets such as 3-D models</a>.
<strong>Prerequisites:</strong> This tutorial assumes that:
</p>
<ul>
<li><div> You have <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/wiki/doku.php/"><paramname="text"value="<html><u>downloaded the jMonkeyPlatform</u></html>"><paramname="textColor"value="blue"></object> (or set up the jMonkeyEngine3 in another IDE of your choice)</div>
<li><div> You have <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/wiki/doku.php/"><paramname="text"value="<html><u>downloaded the jMonkeyEngine SDK</u></html>"><paramname="textColor"value="blue"></object> (or set up the jMonkeyEngine3 in another IDE of your choice)</div>
</li>
<li><div> You are have <ahref="/com/jme3/gde/core/docs/sdk/project_creation.html">created a Java SE project with the JME3 libraries on the classpath</a>.</div>
You are ready to create your first jMonkeyEngine3 game! You can generally use the tutorials in this introductory series with any integrated development environment (IDE), such as the jMonkeyPlatform, NetBeans, Eclipse, or run them straight from the commandline. In the following, we will use the jMonkeyPlatform.
You are ready to create your first jMonkeyEngine3 game! You can generally use the tutorials in this introductory series with any integrated development environment (IDE), such as the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, NetBeans, Eclipse, or run them straight from the commandline. In the following, we will use the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
</p>
</div>
@ -34,7 +34,7 @@ Create a <code>jme3test.helloworld</code> package and a file <code>HelloJME3.jav
</p>
<p>
In the jMonkeyPlatform, you right-click the Source Packages node:
In the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, you right-click the Source Packages node:
</p>
<ul>
<li><div> Select <code>New… > Java Class</code> to create a new file.</div>
@ -134,7 +134,7 @@ The code above has initialized the scene, and started the game.
<td>You want the cube to appear in the scene.</td><td>You attach the cube to the rootNode.</td>
@ -246,7 +246,7 @@ Texture splatting allows you create a custom material, and "paint" tex
</p>
<p>
<p><div>The jMonkeyPlatform comes with a <ahref="/com/jme3/gde/core/docs/sdk/terrain_editor.html">TerrainEditor plugin</a>. Using the TerrainEditor plugin, you can sculpt the terrain with the mouse, and save the result as heightmap. You can paint textures on the terrain and the plugin saves the resulting splat textures as alphamap(s). The following paragraphs describe the manual process for you. You can choose to create the terrain by hand, or using the <ahref="/com/jme3/gde/core/docs/sdk/terrain_editor.html">TerrainEditor plugin</a>.
<p><div>The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> comes with a <ahref="/com/jme3/gde/core/docs/sdk/terrain_editor.html">TerrainEditor plugin</a>. Using the TerrainEditor plugin, you can sculpt the terrain with the mouse, and save the result as heightmap. You can paint textures on the terrain and the plugin saves the resulting splat textures as alphamap(s). The following paragraphs describe the manual process for you. You can choose to create the terrain by hand, or using the <ahref="/com/jme3/gde/core/docs/sdk/terrain_editor.html">TerrainEditor plugin</a>.
</div></p>
</p>
@ -544,7 +544,7 @@ Can you combine what you learned here and in <a href="/com/jme3/gde/core/docs/jm
<p>
You have learned how to create terrains that are more efficient as loading one giant model. You know how to create generate random or handmade heightmaps. You can add a LOD control to render large terrains faster. You are aware that you can combine what you learned about collison detection to make the terrain solid to a physical player. You are also able to texture a terrain "like a boss" using layered Materials and texture splatting. You are aware that the jMonkeyPlatform provides a TerrainEditor that helps with most of these manual tasks.
You have learned how to create terrains that are more efficient as loading one giant model. You know how to create generate random or handmade heightmaps. You can add a LOD control to render large terrains faster. You are aware that you can combine what you learned about collison detection to make the terrain solid to a physical player. You are also able to texture a terrain "like a boss" using layered Materials and texture splatting. You are aware that the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> provides a TerrainEditor that helps with most of these manual tasks.
@ -132,7 +132,7 @@ You create 3-D models in a 3-D mesh editor, for example Blender, and export it i
<div>
<p>
Use the jMonkeyPlatform to convert models from Ogre <acronymtitle="Extensible Markup Language">XML</acronym> or Wavefront OBJ formats to .j3o binary format. Load the .j3o file using the AssetManager.
Use the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> to convert models from Ogre <acronymtitle="Extensible Markup Language">XML</acronym> or Wavefront OBJ formats to .j3o binary format. Load the .j3o file using the AssetManager.
</p>
<pre>// To load .../jMonkeyProjects/MyGame/assets/Models/Ninja/Ninja.mesh.xml
<td>setFrequency(60)</td><td>The screen frequency (refresh rate of the graphics card), usually 60 or 75 fps.</td><td>60 fps</td>
</tr>
<tr>
<td>setFramerate(60)</td><td>How often per second the engine should try to refresh the frame. For the release, usually 60 fps. Can be lower (59-30) for FX-intensive games. No use setting it to a higher value than the screen frequency. If the framerate goes below 30 fps, viewers start to notice choppiness or flickering.</td><td>-1 (auto)</td>
<td>setFramerate(60)</td><td>How often per second the engine should try to refresh the frame. For the release, usually 60 fps. Can be lower (30) if you need to free up the CPU for other applications. No use setting it to a higher value than the screen frequency! If the framerate goes below 30 fps, viewers start to notice choppiness or flickering.</td><td>-1 (unlimited)</td>
</tr>
<tr>
<td>setFullscreen(true)</td><td>Set this to true to make the game window fill the whole screen; you need to provide a key that calls app.stop() to exit the fullscreen view gracefully (default: escape). <br/>
@ -71,11 +68,13 @@ Set multisampling to 2 or 4 to activate antialising (softer edges, may be slower
Depending on your graphic card, you may be able to set multisampling to higher values such as 8, 16, or 32 samples.</td><td>0</td>
</tr>
<tr>
<td>setVSync(true)</td><td>Set vertical syncing to true to time the frame buffer to coincide with the refresh interval of the screen: Prevents page tearing, but slower; recommened for release. <br/>
Set to false to deactivate vertical syncing (faster, but possible page tearing artifacts); can be deactivated during development.</td><td>false</td>
<td>setVSync(true) <br/>
setFrequency(60)</td><td>Set vertical syncing to true to time the frame buffer to coincide with the refresh frequency of the screen. VSync prevents ugly page tearing artefacts, but is a bit slower; recommened for release build. <br/>
Set VSync to false to deactivate vertical syncing (faster, but possible page tearing artifacts); can remain deactivated during development or for slower PCs.</td><td>false <br/>
<td>setAudioRenderer(AppSettings.LWJGL_OPENAL)</td><td>Switch Audio Renderer. Currently there is only one option. </td><td>OpenAL</td>
</tr>
<tr>
<td>setStereo3D(true)</td><td>Enable 3D stereo. This feature requires hardware support from the GPU driver. See <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Quad_buffering"><paramname="text"value="<html><u>Quad Buffering</u></html>"><paramname="textColor"value="blue"></object>.</td><td>false</td>
<td>setStereo3D(true)</td><td>Enable 3D stereo. This feature requires hardware support from the GPU driver. See <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Quad_buffering"><paramname="text"value="<html><u>Quad Buffering</u></html>"><paramname="textColor"value="blue"></object>. Currently, your everday user's hardware does not support this, so you can ignore it for now.</td><td>false</td>
@ -113,7 +111,7 @@ ImageIO.read(new File("")), …});</td><td>This specifies the little a
<td>setSettingsDialogImage("/path/to/splash.png")</td><td>A custom splashscreen image in the assets directory which is displayed when the settings dialog is shown.</td><td>"/com/jme3/app/Monkey.png"</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [3788-4435] -->
<!-- EDIT4 TABLE [3918-4565] -->
</div>
<h2><a>Saving and Loading Settings</a></h2>
@ -155,4 +153,4 @@ Provide the unique name of your jME3 application as the String argument. For exa
Use an <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Issue_tracking_system"><paramname="text"value="<html><u>issue and bug tracker</u></html>"><paramname="textColor"value="blue"></object> to outline what features you want and what components are needed.
</p>
<ol>
<li><div> Pre-Alpha</div>
<ol>
<li><div> Lay out the overall application flow using mock-ups or stock art. E.g. switching between intro screen / options screen / game screen.</div>
<li><div> Artwork: Test asset loading and saving with mock-ups and stock art.</div>
</li>
<li><div> Lay out the overall application flow, i.e. switching between intro / options / game screen, etc.</div>
</li>
<li><div> Get one typical level working. E.g. if it's a "Jump'n'Run", jumping and running must work before you can call it an Alpha.</div>
<li><div> Get one typical level working. E.g. if the game is a "Jump'n'Run", jumping and running must work before you can announce Alpha.</div>
<li><div>Artwork: Replace all mock-ups with first drafts of real media and level maps.</div>
</li>
<li><div> Replace all mock-ups with first drafts of real media and levels.</div>
<li><div> Run alpha tests, track bugs, debug, optimize.</div>
</li>
<li><div>Feature Freeze: Avoid a bottomless pit of side effects causing new issues.</div>
<li><div>Declare <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Feature_freeze"><paramname="text"value="<html><u>Feature Freeze</u></html>"><paramname="textColor"value="blue"></object> before you announce Beta. This prevents a bottomless pit of new bugs.</div>
</li>
</ol>
</li>
<li><div> Beta</div>
<li><div> Beta Release</div>
<ol>
<li><div>Have external people review and "beta test" it (issue tracker).</div>
<li><div>Artwork: Fill in the final media and level maps.</div>
</li>
<li><div>Even out the kinks in the code – don't add any more new features.</div>
<li><div>Have external people review and "beta test" it (track bugs).</div>
</li>
<li><div>Fill in all final content.</div>
<li><div>Even out the kinks in code and gameplay – don't add any more new features.</div>
</li>
</ol>
</li>
<li><div> Gamma, Delta = Release Candidates</div>
<ol>
<li><div> Last chance to find a horrible bug.</div>
<li><div>Test the heck out of it. Last chance to find a horrible bug.</div>
How you actually name or number these milestones is up to you. People use the words "milestone", Greek letters, version numbers, or combinations thereof.
Every milestone is made up of a development phase and a test phase. Here are some best practices:
How you name or number these stages is fully up to you. Development teams use the word milestone, Greek letters, version numbers, or combinations thereof.
Every milestone is made up of a development phase and a test phase. Here are some best practices:
</p>
</div>
@ -126,25 +133,32 @@ Every milestone is made up of a development phase and a test phase. Here are som
<h3><a>Where to Start?</a></h3>
<div>
<p>
<p><div>Many game developers dream of creating their very own "MMORPG with full-physics, AI, post-rendering effects, multi-player networking, procedurally generated maps, and customizable characters". So why aren't there tons of MMORPGs out there? Even for large experienced game producers, the creation of such a complex game is time-intensive and failure-prone. How familiar are you with multi-threading, persistance, optimization, client-server synchonization, …? Unless your answer is "very!", then start with a single-player desktop game, and work your way up – just as the pros did when they started.
</div></p>
</p>
<p>
You have a list of features that you want in game, but which one do you implement first? You will keep adding features to a project that grows more and more complex, how can you minimize the amount of rewriting required?
</p>
<ol>
<li><div> Start with implementing the most complex game feature first – the one that imposes most constraints on the structure of your project (for instance, networking.)</div>
<li><div>Make sure the game's high-level frame (screen switching, networking, loading/saving) is sound and solid. </div>
</li>
<li><div>Make sure the game's high-level frame (screen switching, networking, physics, loading/saving) is sound and solid before you implement low-level details of gameplay.</div>
<li><div>Start with implementing the most complex game feature first – the one that imposes most constraints on the structure of your project (for instance, networking, physics.)</div>
</li>
<li><div> Only add one larger feature at a time. If there are complex interactions (such as "networking + physics"), start with a small test case ("one cube") and work your way up, don't start with a whole scene.</div>
<li><div> Add only one larger feature at a time. If there are complex interactions (such as "networking + physics"), start with a small test case ("one cube") and work your way up, don't start with a whole scene.</div>
</li>
<li><div> Implement low-complexity details (audio and visual effects) last.</div>
</li>
<li><div> Test for side-effects on existing code before you add the next feature.</div>
</li>
</ol>
<p>
Acknowledge whether you want a feature because it is necessary for gameplay, or simply because "everyone else has it". Successful high-performance games are the ones where someone made smart decisions what to keep and what to drop. <br/>
<strong>Consider this:</strong> Everybody wants "full physics, AI, post-rendering effects, and multi-player networking"… Make certain you truly understand what that requires (e.g. client-server synchonization)! Your goal should be to bring out the essence of your game idea, don't water down gameplay but attempting to make it "do everything, but better".
<p><div>Acknowledge whether you want a feature because it is necessary for gameplay, or simply because "everyone else has it". Your goal should be to bring out the essence of your game idea. Don't water down gameplay but attempting to make it "do everything, but better". Successful high-performance games are the ones where someone made smart decisions what to keep and what to drop.
</div></p>
</p>
</div>
@ -153,40 +167,54 @@ Acknowledge whether you want a feature because it is necessary for gameplay, or
<div>
<p>
Typically, developers extend a custom base class off of jME3's com.jme3.app.SimpleApplication. For all your games you will want a certain basic frame – for example methods for loading and saving scenes, physics, networking, and multi-player logon screen, switching to settings screen, etc. Then you reuse (extend) your own generic game class and create a specific game, for example a racing game, or a space game, or a shooter. <br/>
Extend your custom base class off of jME3's com.jme3.app.SimpleApplication. For all your games, you will want a customized basic framework: Methods for loading and saving scenes, screen switching (logon/start screen, options, game screen, etc), physics, networking, etc. Then you reuse (extend) your own generic game class when you create any specific game (a racing game, or a space game, a shooter, etc).
</p>
<p>
Follow these steps:
</p>
<ol>
<li><div> Create a generic game class for your own "game development business":</div>
<li><div> Create a generic library for your own "game development business":</div>
<ol>
<li><div> Create a jME3-based project with all necessary JARs on the classpath.</div>
<li><div> Create a jME3-based project MyBaseGame with all necessary JARs on the classpath.</div>
</li>
<li><div> Create a class in this package and name it something like <code>my.company.MyBaseGame.java</code>.</div>
</li>
<li><div> Make MyBaseGame extend com.jme3.app.SimpleApplication.</div>
<ol>
<li><div> Make MyBaseGame extend com.jme3.app.SimpleApplication.</div>
</li>
<li><div> Include generic assets (company logo, reusable <acronymtitle="Graphical User Interface">GUI</acronym> elements in your company style, etc) in the MyBaseGame's assets directory.</div>
</li>
<li><div> Implement <em>generic</em> features in the MyBaseGame class: Screen switching,<acronymtitle="Graphical User Interface">GUI</acronym>, game saving, etc. </div>
<li><div> Implement <em>generic</em>game features in the MyBaseGame class: <acronymtitle="Graphical User Interface">GUI</acronym> (start screen, highscore screen), screen switching and pausing, the in-game HUD, level loading, saving and loading games, AppSettings, the main() method, etc. </div>
</li>
</ol>
</li>
<li><div> Build the project. You get a JAR file, your custom MyBaseGame.jar.</div>
</li>
</ol>
</li>
<li><div> Create your actual game, e.g. a shooter:</div>
<li><div> Create your actual game, e.g. a zombie shooter:</div>
<ol>
<li><div> Create a another JME3-based project with all necessary JME3 JARs on the classpath.</div>
<li><div> Create a second JME3-based project, MyZombieGame, with all necessary JME3 JARs on the classpath.</div>
</li>
<li><div> Create a package for the game, e.g. <code>my.company.zombieshooter.MyGame.java</code>.</div>
<li><div> Create a package for the game, e.g. <code>my.company.zombieshooter.MyZombieGame.java</code>.</div>
</li>
<li><div> Add your MyBaseGame.jar to the classpath of MyGame.java.</div>
</li>
<li><div> Make MyGame.java's main class extend MyBaseGame.</div>
<li><div> Add MyBaseGame.jar to the classpath of MyZombieGame. You can now re-use you custom generic game library.</div>
<ol>
<li><div> The specific assets (scenes, models) of this game go into MyGame's own assets folder.</div>
<li><div> Make MyZombieGame.java extend your MyBaseGame class (which extends SimpleApplication).</div>
<ul>
<li><div> MyZombieGame.java has no main() method because it uses the inherited main() method. </div>
</li>
<li><div> MyZombieGame.java makes super calls and overrides the SimpleApplication methods it inherited: <pre> public void simpleInitApp(){ super.simpleInitApp(); }
public void simpleUpdate(float tpf){ super.simpleUpdate(tpf); }
public void simpleRender(RenderManager rm){ super.simpleRender(rm); }</pre>
</div>
</li>
</ul>
</li>
<li><div> Place the specific assets (scenes, models) of this game go into MyZombieGame's own assets folder.</div>
</li>
<li><div> Now implement this specific game's mechanics and levels – without having to worry about logon&settings screens and all the other features that you already dealt with in MyBaseGame.</div>
<li><div>After the generic super calls, add the specific game code for this game. Now you can implement this specific game's mechanics and levels using controls and app states, without having to worry about logon&settings screens and all the other generic features that you already dealt with in MyBaseGame.</div>
</li>
</ol>
</li>
@ -196,17 +224,35 @@ Follow these steps:
</div>
<h3><a>Store Custom Data in Spatials Using setUserData()</a></h3>
<h3><a>The Smart Way to Add Custom Methods and Fields to Nodes</a></h3>
<div>
<p>
Game elements often carry custom data with them. For example, players have health, gold coins, an inventory, equipment, etc. jME3 lets you store custom Java objects in <ahref="/com/jme3/gde/core/docs/jme3/advanced/spatial.html">Spatial</a>s. This way, your custom data is accessible where ever the Spatial is accessible. Read the <ahref="/com/jme3/gde/core/docs/jme3/advanced/spatial.html">Spatial</a> documentation to learn more about how to use the <code>setUserData()</code> method on Nodes and Geometries.
Game elements (Spatials such as Nodes and Geometrys) often carry custom fields and custom methods with them. For example, players have health, gold coins, an inventory, equipment, etc. You may have methods that modify the player state, such as addGold(), addHealth(), pickUpItem(), dropItem(), wieldItem(), etc.
</p>
<p>
<strong>Anti-Pattern:</strong> In Java it's possible that you extend the Node class to create a custom Node class. But be aware not to get trapped by the following anti-pattern: You might try to create different character nodes with <code>MyMobileNode extends Node</code> and then <code>MyNPC extends MyMobileNode</code>. Then you might continue creating subclasses such as <code>MyCityGuardNPC extends MyNPC</code> and <code>MyShopKeeperNPC extends MyNPC</code>. What do you do now if you need a MyShopKeeperNPC that also fights, do you write a whole new MyFightingShopKeeperNPC class? Inheritance does not help you here.
</p>
<p>
Also, extending a Node just to add custom fields to it is unneccesary, because you can store any custom Java objects in Spatials! This user data is accessible where ever the Spatial is accessible. Read the <ahref="/com/jme3/gde/core/docs/jme3/advanced/spatial.html">Spatial</a> documentation to learn more about how to use the <code>setUserData()</code> method on Nodes and Geometries.
</p>
<p>
In short: Don't extend Node to implement game mechanics of your entities. Instead:
</p>
<ul>
<li><div> Add <ahref="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html">Custom Controls</a> to supply your Nodes with custom methods!</div>
</li>
<li><div> Use <ahref="/com/jme3/gde/core/docs/jme3/advanced/spatial.html">''setUserData()''</a> to add custom data fields to Spatials!</div>
</li>
</ul>
</div>
<h3><a>Controls and AppStates -- The Smart Way to Implement Game Logic</a></h3>
<h3><a>The Smart Way to Implement Game Logic: Controls and AppStates</a></h3>
<div>
<p>
@ -236,7 +282,7 @@ Move game behaviour into reusable classes of their own. In jME3 these resuable c
</li>
<li><div> Each AppState brings its own set of game states: You write code so that enabling and disabling an AppState activates and deactivates one particular set of class fields, <acronymtitle="Graphical User Interface">GUI</acronym>, spatials, input handlers, etc. This way you use AppStates to switch between e.g. an InGameState and a MainMenuState.</div>
</li>
<li><div> Examples: The integrated jBullet physics simulation, an overall artificial intelligence AppState that coordinates cooperating enemies, an in-game AppState that loads the scene and the HUD and activates the in-game input mappings, a main menu AppState that switches input handling (clicks are interprested differently than in game) and displays buttons and lets the user open highscore and settings screens, etc.</div>
<li><div> Examples: The integrated jBullet physics simulation, an overall artificial intelligence AppState that coordinates cooperating enemies, an in-game AppState that loads the scene and the HUD and activates the in-game input mappings, a main menu AppState that switches input handling (clicks are interpreted differently than in game) and displays buttons and lets the user open highscore and settings screens, etc.</div>
</li>
</ul>
</li>
@ -268,7 +314,7 @@ Both Control and AppState automatically hook into the main update loop.
<p>
Read more about <ahref="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html">Custom Controls</a> and <ahref="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> here.
Read all about <ahref="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html">Custom Controls</a> and <ahref="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> here.
</p>
</div>
@ -292,13 +338,13 @@ Read more about <a href="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.h
Put your assets into subfolders of your project's <code>assets</code> directory. This is the default path where the AssetManager looks for files.
</p>
<pre>jMonkeyProjects/MyGame/assets/ # Store assets in subfolders here!
jMonkeyProjects/MyGame/build/ # jMP generates built classes here *
jMonkeyProjects/MyGame/build/ # SDK generates built classes here *
jMonkeyProjects/MyGame/build.xml # Customize Ant build script here
jMonkeyProjects/MyGame/nbproject/ # jMP stores default build.xml and meta data *
jMonkeyProjects/MyGame/dist/ # jMP generates executables here *
jMonkeyProjects/MyGame/nbproject/ # SDK stores default build.xml and meta data *
jMonkeyProjects/MyGame/dist/ # SDK generates executables here *
jMonkeyProjects/MyGame/src/ # Store Java sources here
jMonkeyProjects/MyGame/test/ # Store test classes here (optional)
(*) managed by jMonkeyPlatform, don't edit</pre>
(*) managed by jMonkeyEngine SDK, don't edit</pre>
<ul>
<li><div> Agree on a file and directory naming scheme with the graphic designers.</div>
@ -402,7 +448,7 @@ Whether you work in a team or alone, keeping a version controlled repository of
<ul>
<li><div> Treat commit messages as messages to your future self. "Made some changes" is <em>not</em> a commit message.</div>
</li>
<li><div> The jMonkeyPlatform supports Subversion, Mercurial, and <acronymtitle="Concurrent Versions System">CVS</acronym>.</div>
<li><div> The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> supports Subversion, Mercurial, and <acronymtitle="Concurrent Versions System">CVS</acronym>.</div>
<ul>
<li><div> If you don't know which to choose, Subversion is a good choice for starters.</div>
</li>
@ -419,7 +465,7 @@ Whether you work in a team or alone, keeping a version controlled repository of
<p>
From the beta on, convert all models and scenes (Ogre mesh and Wavefront and Blender) to jME3's binary .j3o format. Use the jMonkeyPlatform for the conversion, and save the .j3o files into the Models directory.
From the beta on, convert all models and scenes (Ogre mesh and Wavefront and Blender) to jME3's binary .j3o format. Use the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> for the conversion, and save the .j3o files into the Models directory.
</p>
<ul>
<li><div> .j3o is an optimized format to store part of a jME3 scenegraph. <br/>
@ -468,7 +514,7 @@ Alpha and Beta Testing means that you ask someone to try to install and run your
<p>
A <ahref="/com/jme3/gde/core/docs/sdk/debugging_profiling_testing.html">Java Debugger</a> is included in the jMonkeyPlatform. It allows you to set a break point in your code near the point where an exception happens. Then you step through the execution line by line and watch object and variable states to detect where the bug starts.
A <ahref="/com/jme3/gde/core/docs/sdk/debugging_profiling_testing.html">Java Debugger</a> is included in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>. It allows you to set a break point in your code near the point where an exception happens. Then you step through the execution line by line and watch object and variable states to detect where the bug starts.
</p>
<p>
@ -482,7 +528,7 @@ Use the <a href="/com/jme3/gde/core/docs/jme3/advanced/logging.html">Logger</a>
<p>
You can add a <ahref="/com/jme3/gde/core/docs/sdk/debugging_profiling_testing.html">Java Profiler</a> to the jMonkeyPlatform via Tools → Plugins → Available. The profiler presents statistics on the lifecycle of methods and objects. Performance problems may be caused by just a few methods that take long, or are called too often. If object creation and garbage collection counts keep increasing, you are looking at a memory leak.
You can add a <ahref="/com/jme3/gde/core/docs/sdk/debugging_profiling_testing.html">Java Profiler</a> to the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> via Tools → Plugins → Available. The profiler presents statistics on the lifecycle of methods and objects. Performance problems may be caused by just a few methods that take long, or are called too often. If object creation and garbage collection counts keep increasing, you are looking at a memory leak.
</p>
</div>
@ -521,7 +567,7 @@ You can add a <a href="/com/jme3/gde/core/docs/sdk/debugging_profiling_testing.h
</p>
<p>
The jMonkeyPlatform<ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> helps you with deployment (unless you used another IDE, then consult the IDE's documentation). Do you want to release your game as WebStart, Desktop JAR, or Applet? Each has its pros and cons.
The jMonkeyEngine<ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> helps you with deployment (unless you used another IDE, then consult the IDE's documentation). Do you want to release your game as WebStart, Desktop JAR, or Applet? Each has its pros and cons.
</p>
<div><table>
@ -530,7 +576,7 @@ The jMonkeyPlatform <a href="/com/jme3/gde/core/docs/sdk.html">SDK</a> helps you
</tr>
<tr>
<td>Desktop Launcher <br/>
(.EXE, .app, .jar+.sh)</td><td>This is the standard way of distributing desktop applications. The jMonkeyPlatform can be configured to automatically create zipped launchers for each operating system. </td><td>You need to offer three separate, platform-dependent downloads.</td>
(.EXE, .app, .jar+.sh)</td><td>This is the standard way of distributing desktop applications. The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> can be configured to automatically create zipped launchers for each operating system. </td><td>You need to offer three separate, platform-dependent downloads.</td>
</tr>
<tr>
<td>Desktop Application <br/>
@ -549,7 +595,7 @@ The jMonkeyPlatform <a href="/com/jme3/gde/core/docs/sdk.html">SDK</a> helps you
(.APK)</td><td>Game runs on Android devices</td><td>Android devices do not support post-procesor effects.</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [18896-20113] -->
<!-- EDIT1 TABLE [21658-22877] -->
<p>
Which ever method you choose, a Java-Application works on the main operating systems: Windows, Mac <acronymtitle="Operating System">OS</acronym>, Linux, Android.
@ -557,4 +603,4 @@ Which ever method you choose, a Java-Application works on the main operating sys
<td>.j3o</td><td>Binary 3D model or scene. From the Beta release of your game on, you should convert all models to .j3o format. During alpha and earlier development phases (when models still change a lot) you can alternatively load OgreXML/OBJ models directly.</td><td><ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">Model Loader and Viewer</a></td>
<td>.j3o</td><td>Binary 3D model or scene. At the latest from the Beta release of your game on, you should convert all models to .j3o format. <br/>
During alpha and earlier development phases (when models still change a lot) you can alternatively load OgreXML/OBJ models directly.</td><td><ahref="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">Model Loader and Viewer</a></td>
</tr>
<tr>
<td>.j3m</td><td>A custom Material. You create these Material objects to store Material configurations for your 3D models.</td><td><ahref="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a><ahref="/com/jme3/gde/core/docs/sdk/material_editing.html">Material Editing</a></td>
<td>.j3m</td><td>A custom Material. You can create a .j3m file to store a Material configuration for a Geometry (e.g. 3D model).</td><td><ahref="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a><br/>
<td>.j3md</td><td>A Material definition. These are templates for advanced shader-based Materials. Each custom .j3m Material is based on a .j3md Material Definition. </td><td><ahref="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a></td>
<td>.j3md</td><td>A Material definition. These are pre-defined templates for shader-based Materials. <br/>
Each custom .j3m Material is based on a material definition. Advanced users can create their own material definitions. </td><td><ahref="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a></td>
</tr>
<tr>
<td>.j3f</td><td>A file containing a FilterPostProcessor with preconfigured filters. </td><td><ahref="/com/jme3/gde/core/docs/sdk/filters.html">Filters</a></td>
<td>.j3f</td><td>A custom post-processor filter configuration. You can create a .j3f file to store a FilterPostProcessor with a set of preconfigured filters. </td><td><ahref="/com/jme3/gde/core/docs/sdk/filters.html">Filters</a><br/>
<td>.mesh.xml, .meshxml, .scene</td><td>Ogre Mesh <acronymtitle="Extensible Markup Language">XML</acronym> for 3D models, Ogre DotScene for 3D scenes</td>
@ -205,6 +205,7 @@ var NS='jme3:intermediate';var JSINFO = {"id":"jme3:intermediate:headlessserver"
</li>
<li><ahref="#">Project Relations ></a>
<ul>
<li><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/groups/beta-1-game-contest/forum/"><paramname="text"value="<html><u>Beta 1 Game Contest</u></html>"><paramname="textColor"value="blue"></object></li>
<form><div><inputtype="hidden"name="do"value="login"/><inputtype="hidden"name="sectok"value="2ff9e38af20f0157885253273063af54"/><inputtype="submit"value="Login"class="button"title="Login"/></div></form><form><div><inputtype="hidden"name="do"value="index"/><inputtype="submit"value="Sitemap"class="button"accesskey="x"title="Sitemap [X]"/></div></form><a><inputtype="button"class="button"value="Back to top"onclick="window.scrollTo(0, 0)"title="Back to top"/></a>
<form><div><inputtype="hidden"name="do"value="login"/><inputtype="hidden"name="sectok"value="b273fed70c8f61e2ac778ef448e51618"/><inputtype="submit"value="Login"class="button"title="Login"/></div></form><form><div><inputtype="hidden"name="do"value="index"/><inputtype="submit"value="Sitemap"class="button"accesskey="x"title="Sitemap [X]"/></div></form><a><inputtype="button"class="button"value="Back to top"onclick="window.scrollTo(0, 0)"title="Back to top"/></a>
</div>
<div></div>
</div-->
@ -356,7 +357,7 @@ You've followed a link to a topic that doesn't exist yet. If permissio
@ -95,7 +95,7 @@ getStateManager()</td><td>You use the Application's state manager to activa
<th>Application methods</th><th>Purpose</th>
</tr>
<tr>
<td>setPauseOnLostFocus(true)</td><td>Set this boolean whether the game should pause when ever the window loses focus.</td>
<td>setPauseOnLostFocus(true)</td><td>Set this boolean whether the game loop should stop running when ever the window loses focus (typical for single-player game). Set this to false for real-time and multi-player games that keep running. </td>
</tr>
<tr>
<td>start()</td><td>Call this method to start a jME3 game. By default this opens a new jME3 window, initializes the scene, and starts the event loop. </td>
@ -114,7 +114,7 @@ Type.Headless – jME application runs its event loop without calculating any vi
Type.OffscreenSurface – jME application view is not shown and no window opens, but everything calculated and cached as bitmap (back buffer) for use by other applications.</td>
</tr>
</table></div>
<!-- EDIT2 TABLE [3029-4095] --><div><table>
<!-- EDIT2 TABLE [3029-4215] --><div><table>
<tr>
<th>Internal class field/method</th><th>Purpose</th>
</tr>
@ -146,7 +146,7 @@ getGuiViewPort()</td><td>The view object for the orthogonal <acronym title="Grap
<td>paused</td><td>Boolean is used only internally during runtime to pause/unpause a game. (You need to implement your own isRunning boolean or so.)</td>
</tr>
</table></div>
<!-- EDIT3 TABLE [4097-5293] -->
<!-- EDIT3 TABLE [4217-5413] -->
</div>
<h2><a>SimpleApplication Class</a></h2>
@ -187,7 +187,7 @@ getGuiNode()</td><td>Attach flat <acronym title="Graphical User Interface">GUI</
getFlyByCamera()</td><td>The default first-person fly-by camera control. This default camera control lets you navigate the 3D scene using the preconfigured WASD and arrow keys and the mouse.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [5862-6405] --><div><table>
<!-- EDIT4 TABLE [5982-6525] --><div><table>
<tr>
<th>SimpleApplication Method</th><th>Purpose</th>
</tr>
@ -204,7 +204,7 @@ getFlyByCamera()</td><td>The default first-person fly-by camera control. This de
<td>setDisplayStatView(false);</td><td>A default SimpleApplication displays mesh statistics on the screen using the com.jme3.app.StatsView class. The information is valuable during the development and debugging phase, but for the release, you should hide the statistics HUD.</td>
@ -218,7 +218,7 @@ getFlyByCamera()</td><td>The default first-person fly-by camera control. This de
<td>public void simpleRender(RenderManager rm)</td><td><strong>Optional:</strong> Override this method to implement <em>advanced</em> modifications of the frameBuffer and scene graph.</td>
</tr>
</table></div>
<!-- EDIT6 TABLE [7201-8119] -->
<!-- EDIT6 TABLE [7321-8239] -->
<p>
<p><div>Use <code>app.setShowSettings(true);</code> to present the user with a splashscreen and the built-in display settings dialog when starting the game; or use <code>app.setShowSettings(false);</code> to hide the buil-in screen (in this case, you may want to provide a custom splashscreen and settings panel). Set this boolean before calling <code>app.start()</code> in the <code>main()</code> method of the SimpleApplication. See also <ahref="/com/jme3/gde/core/docs/jme3/intermediate/appsettings.html">AppSettings</a>.
@ -249,7 +249,7 @@ The following default navigational input actions are mapped by the default <code
<td>KEY_M</td><td>Prints memory usage stats the out stream.</td>
</tr>
</table></div>
<!-- EDIT7 TABLE [8822-9013] -->
<!-- EDIT7 TABLE [8942-9133] -->
<p>
As long as useInput() is true, the default Flyby Cam is active. Then the following so-called "WASD" inputs are additionally available:
@ -290,16 +290,16 @@ As long as useInput() is true, the default Flyby Cam is active. Then the followi
<td>Rotate Down</td><td>KEY_DOWN, or move mouse vertically backward (-y)</td>
Although we recommend the <ahref="/com/jme3/gde/core/docs/sdk.html">jMonkeyPlatform</a> for developing JME3 games, you can use any IDE (integrated development environment) such as <ahref="/com/jme3/gde/core/docs/jme3/setting_up_netbeans_and_jme3.html">NetBeans</a> or <ahref="/com/jme3/gde/core/docs/jme3/setting_up_jme3_in_eclipse.html">Eclipse</a>, and even work freely from the commandline. Here is a generic IDE-independent "getting started" tutorial.
Although we recommend the jMonkeyEngine <ahref="/com/jme3/gde/core/docs/sdk.html">SDK</a> for developing JME3 games, you can use any IDE (integrated development environment) such as <ahref="/com/jme3/gde/core/docs/jme3/setting_up_netbeans_and_jme3.html">NetBeans</a> or <ahref="/com/jme3/gde/core/docs/jme3/setting_up_jme3_in_eclipse.html">Eclipse</a>, and even work freely from the commandline. Here is a generic IDE-independent "getting started" tutorial.
</p>
<p>
@ -192,4 +192,4 @@ Now follow the <a href="/com/jme3/gde/core/docs/jme3.html">tutorials</a> and wri
@ -449,7 +449,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: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/wiki/doku.php/jme3:jmonkeyplatform:neotexture"><paramname="text"value="<html><u>jMonkeyPlatform NeoTexture plugin</u></html>"><paramname="textColor"value="blue"></object>
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: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/wiki/doku.php/sdk:neotexture"><paramname="text"value="<html><u>jMonkeyEngine SDK NeoTexture plugin</u></html>"><paramname="textColor"value="blue"></object>
</p>
<p>
@ -604,4 +604,4 @@ There are lots of resources explaining interesting AI algorithms:
When you <ahref="/com/jme3/gde/core/docs/sdk/application_deployment.html">use the jMonkeyPlatform to deploy your application</a>, you can configure the project to build files required for WebStart automatically. If you use another IDE, or work on the command line, use the following tips to set up WebStart correctly:
When you <ahref="/com/jme3/gde/core/docs/sdk/application_deployment.html">use the jMonkeyEngine SDK to deploy your application</a>, you can configure the project to build files required for WebStart automatically. If you use another IDE, or work on the command line, use the following tips to set up WebStart correctly:
</p>
</div>
<h2><a>Problem Statement</a></h2>
<div>
<p>
Problem:
<strong>Problem:</strong>
</p>
<p>
@ -16,7 +22,7 @@ When running under WebStart, jMonkeyEngine may not have permission to extract th
After you have written and tested your game, you want to brand it and distribute it to your users. If you use the build script provided by the jMonkeyPlatform's BaseGame, you have the following deployment options:
After you have written and tested your game, you want to brand it and distribute it to your users. If you use the build script provided by the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>'s BaseGame, you have the following deployment options:
</p>
<ul>
<li><div> Desktop application (.JAR)</div>
@ -38,7 +38,7 @@ Since JAR files are platform independent, your customers can play your jMonkeyEn
Make your game unique and recognizable:
</p>
<ol>
<li><div> Open your game project in the jMonkeyPlatform's Projects window.</div>
<li><div> Open your game project in the <acronymtitle="Software Development Kit">SDK</acronym>'s Projects window.</div>
</li>
<li><div> Right-click the project and open the Properties</div>
</li>
@ -74,7 +74,7 @@ Your executables are now branded.
<p>
<imgsrc="/wiki/lib/exe/fetch.php">
When you run the build script provided by the jMonkeyPlatform, it automatically compiles your classes, libraries, and assets. It creates a <code>dist</code> directory in your project directory which contains the executable JAR and a directory with libraries.
When you run the build script provided by the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, it automatically compiles your classes, libraries, and assets. It creates a <code>dist</code> directory in your project directory which contains the executable JAR and a directory with libraries.
</p>
<p>
@ -120,7 +120,7 @@ Most operating systems execute a JAR when users double-click on it, but you can
<p>
jMonkeyPlatform allows you to create launchers for different desktop platforms, like an .exe file for Windows systems, an Application for MaxOSX and a launcher for Linux systems.
jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> allows you to create launchers for different desktop platforms, like an .exe file for Windows systems, an Application for MaxOSX and a launcher for Linux systems.
</p>
<ol>
<li><div> Right-click your project and open the Project Properties.</div>
@ -168,7 +168,7 @@ Web Start allows your users to start your application by simply clicking a link
</ol>
<p>
Look at the sample launch.html, you can have any custom content around the link. Keep a copy of your launcher file because the jMonkeyPlatform will always regenerate its default launch.html.
Look at the sample launch.html, you can have any custom content around the link. Keep a copy of your launcher file because the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> will always regenerate its default launch.html.
Also, see this <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://www.youtube.com/watch?v=oZnssg8TBWQ"><paramname="text"value="<html><u>demo video</u></html>"><paramname="textColor"value="blue"></object> on creating WebStarts.
</p>
@ -183,7 +183,7 @@ A browser Applet is a Java application that runs in the web browser while the us
</p>
<p>
These instrcutions assume that you have already written a game that you want to turn into an Applet. As opposed to other jME3 games, Applets cannot capture the mouse for navigation, so the camera will be switched to dragToRotate mode. The jMonkeyPlatform and the included build script already contain what you need.
These instrcutions assume that you have already written a game that you want to turn into an Applet. As opposed to other jME3 games, Applets cannot capture the mouse for navigation, so the camera will be switched to dragToRotate mode. The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> and the included build script already contain what you need.
</p>
@ -207,7 +207,7 @@ These instrcutions assume that you have already written a game that you want to
</ol>
<p>
The <code>dist/Applet</code> directory now contains all the files necessary for the game to run as Applet. To test the Applet-based game, run the project in the jMonkeyPlatform.
The <code>dist/Applet</code> directory now contains all the files necessary for the game to run as Applet. To test the Applet-based game, run the project in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
</p>
@ -244,7 +244,7 @@ The <code>dist/Applet</code> directory now contains all the files necessary for
<p>
You can set the jMonkeyPlatform to build an executable for Android mobile platforms. Learn more about <ahref="/com/jme3/gde/core/docs/jme3/android.html">Android Support</a> here.
You can set the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> to build an executable for Android mobile platforms. Learn more about <ahref="/com/jme3/gde/core/docs/jme3/android.html">Android Support</a> here.
</p>
</div>
@ -253,7 +253,7 @@ You can set the jMonkeyPlatform to build an executable for Android mobile platfo
<div>
<p>
The jMonkeyPlatform has a Run Configuration menu in the toolbar. Use it to save your various sets of Project Property configuations, and switch between them.
The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> has a Run Configuration menu in the toolbar. Use it to save your various sets of Project Property configuations, and switch between them.
</p>
<ol>
<li><div> Click the <code>Set Project Configuration</code> popup in the toolbar and choose Customize.</div>