Many questions about various aspects of materials

Im going to just jump right into it…





Part 1 : My tool chain, process, and issue



Im using blender 2.5x and JME3 (not the nightly builds, but I cant imagine something this basic is affected so severely that it breaks in this manner, also Im using Ubuntu (Karmic) and the nightly completely breaks JME3 to the point that it is unusable)

I create a model in blender and export as a wavefront .obj (a .mtl file is also generated at this point). I place the .obj and .mtl in the assets/models folder. I right click the model file and convert to .j3o. I hit F6 to build and run the app. The model loads and renders, but there is no texture (Thats the main issue)


Part 2 : My research into this, and the questions

a) In Hello Assets (https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset), ignore all but the part where the ninja is loaded. It seems that this :

Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");

loads the model, textures, and material, creating all the necessary objects automatically (material, texture, assign texture to material, mesh, etc...). Is this NOT the way it works with wavefront obj files as well? (It does not seem to be, but it would mean a lot to me to know for sure one way or another) Example : I replace the ninja.xml with my robot.obj, and the only thing that does not work is the texture does not show up.

b) How would you go about assigning multiple materials to one model? (not in blender, I can do that)

c) In hello materials (https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_material), boxshape1 gets the monkey face texture applied to it. How are texture coordinates set there? It just seems to magically apply the image at the right size on each face.

d) What is the relationship between .mtl and .J3MD? It seems both define a material, is there a way to convert between the two or am I way off base here? (If I could get just one question answered it would be this one)


Part 3 : Code, complete with comments where you can see what Ive tried. This code runs as it is. (Just no texture!)

[java]package mygame;

import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.math.FastMath;
import com.jme3.system.AppSettings;
import com.jme3.light.*;

/**
* test
* @author normenhansen
*/
public class Main extends SimpleApplication {

public static void main(String[] args) {
AppSettings settings = new AppSettings(true);//leave this true
settings.setResolution(1200,900);
settings.setTitle("Hi there");

Main app = new Main();
app.setSettings(settings);
app.setShowSettings(false);
app.start();
}

@Override
public void simpleInitApp() {
viewPort.setBackgroundColor(ColorRGBA.Blue);
Spatial robot = assetManager.loadModel("Models/robot3.j3o");
robot.scale(1f, 1f, 1f);
robot.rotate(0f,FastMath.PI,0f);
robot.setLocalTranslation(0f,0f,0f);


//Material mat = new Material(assetManager, "Models/target.mtl");
//Material mat = new Material(
// assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
//mat.setTexture("ColorMap",
// assetManager.loadTexture("Textures/bluetiles1.jpg"));
//disc.setMaterial(mat);
rootNode.attachChild(robot);

DirectionalLight light_dir = new DirectionalLight();
AmbientLight light_amb = new AmbientLight();
light_dir.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(light_amb);
rootNode.addLight(light_dir);





flyCam.setMoveSpeed(70);
}

@Override
public void simpleUpdate(float tpf) {
//TODO: add update code
}

@Override
public void simpleRender(RenderManager rm) {
//TODO: add render code
}
}
[/java]

Check the log, maybe the texture cannot be found? Could you post your .mtl file?

Blender MTL File: ‘robot1.blend’

Material Count: 2

newmtl Material

Ns 96.078431

Ka 0.000000 0.000000 0.000000

Kd 0.640000 0.640000 0.640000

Ks 0.500000 0.500000 0.500000

Ni 1.000000

d 1.000000

illum 2





newmtl chest

Ns 96.078431

Ka 0.000000 0.000000 0.000000

Kd 0.640000 0.050755 0.042606

Ks 0.500000 0.500000 0.500000

Ni 1.000000

d 1.000000

illum 2

Missed the last line



map_Kd /home/jason/Desktop/scrapImages/textures/rocks1.jpg



I also tried packing external data into the blend file.



I also tried playing with that path, and put the image into Textures folder as well.

I get this when trying to convert robot.obj into j3o now :



java.lang.NullPointerException

at com.jme3.scene.plugins.OBJLoader.readFace(OBJLoader.java:250)

at com.jme3.scene.plugins.OBJLoader.readLine(OBJLoader.java:331)

at com.jme3.scene.plugins.OBJLoader.load(OBJLoader.java:516)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:243)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:379)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:389)

[catch] at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:81)

at com.jme3.gde.core.assets.actions.ConvertModel$1.run(ConvertModel.java:63)

at java.lang.Thread.run(Thread.java:636)



I think its not finding something, but I do not know what. I gotta log off for now :frowning: Ill experiment more when I can. Thank you!

2a) yes they work same way.

2b) a model has many node children inside it who also have their children. just use get child and cast it to geometry and set material (if ( child instance of Geometry) ((Geometry) child).setMaterial(); ).

2c) no magic. A box has already its texture coordinates defined by jme.

UVS : (0,0) = lower left, (1,1) = upper right. So what box does is have a picture in each side.

2d) you arent supposed to use .obj they have no animation / skeleton. .mtl sucks. Use ogreXml like you are supposed to be, (you would be forced to do it sooner or later).

is there a way to convert between the two or am I way off base here?

Yes jme does it automatically when you convert .obj to .j3o but keeps material parameters stored in .j3o file.

There were some fixes applied to the OBJ/MTL loader. Can you try now? If it doesn’t work, can you provide the model please?

Blender 2.58.1 (factory settings)

JME updated to very latest (Aug 15, 8:25AM)

Ubuntu (also most up to date stable version)

Summary :

Four tests (1-4), comparing 2 separate meshes (in .obj and .j3o formats), using direct or ambient lighting. (all fail)

Two tests with materials (5-6).

Source code at bottom.


TEST 1 :
robot5.obj with robot5.mtl and rocks1.jpg in the same directory
lighting setup :
AmbientLight light_amb = new AmbientLight();
rootNode.addLight(light_amb);
spatial setup :
Spatial robot = assetManager.loadModel("Models/robot5.obj");
robot.scale(1f, 1f, 1f);
robot.rotate(0f,FastMath.PI,0f);
robot.setLocalTranslation(0f,0f,0f);
(clean, build, run)
WARNING: Your graphics card does not support non-power-of-2 textures. Some features might not work.
(resized the texture to 256x256 in gimp, clean, build, run, begin moving away, robot begins to be visible, crashes)
Output :
Building jar: /home/jason/jMonkeyProjects/BasicGame7/build/assets.jar
init:
deps-jar:
Updating property file: /home/jason/jMonkeyProjects/BasicGame7/build/built-jar.properties
Created dir: /home/jason/jMonkeyProjects/BasicGame7/build/classes
Created dir: /home/jason/jMonkeyProjects/BasicGame7/build/empty
Compiling 1 source file to /home/jason/jMonkeyProjects/BasicGame7/build/classes
compile:
run:
Aug 15, 2011 9:02:14 AM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkey Engine 3 Alpha 0.6
Aug 15, 2011 9:02:15 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #1: file:/usr/local/jmonkeyplatform/jmonkeyplatform/libs/
Aug 15, 2011 9:02:15 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #2: /home/jason/jMonkeyProjects/BasicGame7
Aug 15, 2011 9:02:15 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #3: /home/jason/jMonkeyProjects/BasicGame7
Aug 15, 2011 9:02:15 AM com.jme3.system.Natives extractNativeLib
WARNING: Cannot locate native library: linux/libbulletjme.so
Aug 15, 2011 9:02:15 AM com.jme3.system.lwjgl.LwjglAbstractDisplay run
INFO: Using LWJGL 2.7.1
Aug 15, 2011 9:02:15 AM com.jme3.system.lwjgl.LwjglDisplay createContext
INFO: Selected display mode: 1200 x 900 x 0 @0Hz
Aug 15, 2011 9:02:16 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Adapter: null
Aug 15, 2011 9:02:16 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Driver Version: null
Aug 15, 2011 9:02:16 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Vendor: NVIDIA Corporation
Aug 15, 2011 9:02:16 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: OpenGL Version: 2.1.2 NVIDIA 173.14.22
Aug 15, 2011 9:02:16 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Renderer: GeForce FX 5200/AGP/SSE2
Aug 15, 2011 9:02:16 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: GLSL Ver: 1.20 NVIDIA via Cg compiler
Aug 15, 2011 9:02:16 AM com.jme3.system.lwjgl.LwjglTimer
INFO: Timer resolution: 1,000 ticks per second
Aug 15, 2011 9:02:16 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
WARNING: Your graphics card does not support non-power-of-2 textures. Some features might not work.
Aug 15, 2011 9:02:16 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
INFO: Caps: [FrameBuffer, FrameBufferMultisample, OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120]
Aug 15, 2011 9:02:16 AM com.jme3.asset.DesktopAssetManager
INFO: DesktopAssetManager created.
Aug 15, 2011 9:02:16 AM com.jme3.renderer.Camera
INFO: Camera created (W: 1,200, H: 900)
Aug 15, 2011 9:02:16 AM com.jme3.renderer.Camera
INFO: Camera created (W: 1,200, H: 900)
Aug 15, 2011 9:02:16 AM com.jme3.input.lwjgl.LwjglMouseInput initialize
INFO: Mouse created.
Aug 15, 2011 9:02:16 AM com.jme3.input.lwjgl.LwjglKeyInput initialize
INFO: Keyboard created.
Aug 15, 2011 9:02:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: AudioRenderer supports 64 channels
Aug 15, 2011 9:02:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio effect extension version: 1.0
Aug 15, 2011 9:02:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 1
Aug 15, 2011 9:02:17 AM com.jme3.material.MaterialDef
INFO: Loaded material definition: Unshaded
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Gui Node)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (Statistics View) attached to this node (Gui Node)
Aug 15, 2011 9:02:17 AM com.jme3.material.MaterialDef
INFO: Loaded material definition: Phong Lighting
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader createGeometry
WARNING: OBJ mesh robot5-geom-0 doesnt contain normals! It might not display correctly
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (robot5-geom-0) attached to this node (robot5-objnode)
Aug 15, 2011 9:02:17 AM com.jme3.scene.plugins.OBJLoader createGeometry
WARNING: OBJ mesh robot5-geom-1 doesnt contain normals! It might not display correctly
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (robot5-geom-1) attached to this node (robot5-objnode)
Aug 15, 2011 9:02:17 AM com.jme3.scene.Node attachChild
INFO: Child (robot5-objnode) attached to this node (Root Node)
Aug 15, 2011 9:02:18 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform m_VertexColor is not declared in shader.
Aug 15, 2011 9:02:20 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform g_CameraPosition is not declared in shader.
Aug 15, 2011 9:02:20 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform g_WorldMatrix is not declared in shader.
Aug 15, 2011 9:02:20 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform m_UseMaterialColors is not declared in shader.
Aug 15, 2011 9:02:21 AM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.renderer.RendererException: Shader link failure, shader:Shader[language=GLSL100, numSources=2, numUniforms=15, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment]]] info:Fragment info
(126) : warning C7050: "$temp22" might be used before being initialized
Internal error: assembly compile error for fragment shader at offset 1932:
-- error message --
line 61, column 20: error: invalid operand variable
line 74, column 13: error: invalid operand variable
-- internal assembly text --
!!FP1.0
# cgc version 2.0.0018, build date Nov 8 2009 21:26:53
# command line args:
#vendor NVIDIA Corporation
#version 2.0.1.18
#profile fp30
#program main
#semantic g_LightDirection
#semantic m_AlphaDiscardThreshold
#semantic m_Shininess
#var float2 texCoord : : : -1 : 0
#var float3 AmbientSum : $vin.TEX0 : TEX0 : -1 : 1
#var float4 DiffuseSum : $vin.TEX1 : TEX1 : -1 : 1
#var float3 SpecularSum : $vin.TEX2 : TEX2 : -1 : 1
#var float4 g_LightDirection : : : -1 : 1
#var float3 vPosition : : : -1 : 0
#var float3 vViewDir : $vin.TEX3 : TEX3 : -1 : 1
#var float4 vLightDir : $vin.TEX4 : TEX4 : -1 : 1
#var float3 lightVec : $vin.TEX5 : TEX5 : -1 : 1
#var float3 vNormal : $vin.TEX6 : TEX6 : -1 : 1
#var float m_AlphaDiscardThreshold : : : -1 : 1
#var float m_Shininess : : : -1 : 1
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var 4 $kill_0000 : $vout.$kill : $kill : -1 : 0
DECLARE m_AlphaDiscardThreshold;
DECLARE g_LightDirection;
DECLARE m_Shininess;
DP3R R0.y, g_LightDirection, g_LightDirection;
RSQR R0.y, R0.y;
DP3R R0.x, f[TEX5], f[TEX5];
MULR R1.xyz, R0.y, g_LightDirection;
RSQR R0.x, R0.x;
MULR R0.xyz, R0.x, f[TEX5];
DP3R R0.x, -R0, R1;
MOVR R1.w, {0, 0, 0, 0}.x;
FRCR R0.y, g_LightDirection.w;
FLRR R0.z, g_LightDirection.w;
MADR R0.z, R0, {0.001, 0, 0, 0}.x, -R0.y;
ADDR R0.y, R0.x, -R0;
MOVR R0.x, {1, 0, 0, 0};
RCPR R0.z, R0.z;
MOVXC RC.x, g_LightDirection.w;
MULR R0.x(NE), R0.y, R0.z;
SLER H0.z, R0.x, {0, 0, 0, 0}.x;
MOVR R0.y, {0, 0, 0, 0}.x;
SNER H0.y, g_LightDirection.w, R0;
SEQX H0.x, H0.z, {0, 0, 0, 0};
MULXC HC.x, H0.y, H0;
MOVR R0.w, R0.x;
MOVR_SAT R0.w(NE.x), R0.x;
DP3R R0.y, f[TEX4], f[TEX4];
RSQR R0.y, R0.y;
MULR R1.xyz, R0.y, f[TEX4];
MOVX H0.x, {0, 0, 0, 0};
MULXC HC.y, H0, H0.z;
MOVR R0.x, {1, 0, 0, 0};
SLER H0.y, m_Shininess.x, R0.x;
MOVH H0.x(EQ.y), {1, 0, 0, 0};
MULXC HC.x, H0, H0.y;
MOVX H0.y, {0, 0, 0, 0}.x;
MOVR o[COLR].xyz, o[COLR];
DP3R R0.x, f[TEX6], f[TEX6];
RSQR R0.x, R0.x;
MOVR R1.w(EQ.x), R2.x;
MULR R0.xyz, R0.x, f[TEX6];
DP3R R2.x, R0, R1;
MOVH H0.y(EQ.x), {1, 0, 0, 0}.x;
MULR R0.xyz, -R2.x, R0;
MADR R0.xyz, -R0, {2, 0, 0, 0}.x, -R1;
DP3R R0.x, R0, f[TEX3];
MAXR R0.x, R0, {0, 0, 0, 0};
MULXC HC.x, H0, H0.y;
POWR R1.w(NE.x), R0.x, m_Shininess.x;
MOVR R0.x, o[COLR].w;
MAXR R1.x, R2, {0, 0, 0, 0};
MULR R1.y, R1.x, R1.w;
MULR R1.xy, R1, f[TEX4].w;
MULR R0.zw, R1.xyxy, R0.w;
MULR R1.xyz, f[TEX1], R0.z;
MOVXC RC.x, H0;
MOVR R0.y, f[TEX1].w;
MOVR R0.x(NE.y), f[TEX1].w;
MOVR R0.y(EQ.x), R0.x;
MOVR o[COLR].xyz(NE.y), f[TEX0];
ADDR R1.xyz, R1, f[TEX0];
MADR o[COLR].xyz(NE.x), f[TEX2], R0.w, R1;
SLTRC HC.x, f[TEX1].w, m_AlphaDiscardThreshold;
KIL NE.x;
MOVR o[COLR].w, R0.y;
END
# 62 instructions, 3 R-regs, 1 H-regs
at com.jme3.renderer.lwjgl.LwjglRenderer.updateShaderData(LwjglRenderer.java:1108)
at com.jme3.renderer.lwjgl.LwjglRenderer.setShader(LwjglRenderer.java:1143)
at com.jme3.material.Material.renderMultipassLighting(Material.java:792)
at com.jme3.material.Material.render(Material.java:1009)
at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:656)
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:301)
at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:363)
at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:912)
at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:849)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1125)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1162)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:264)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)
at java.lang.Thread.run(Thread.java:636)
BUILD SUCCESSFUL (total time: 7 seconds)

END TEST 1

TEST 2
Same setup as test 1, but with robot5.j3o
(note : converted .obj -> .j3o with no issues)
spatial setup :
Spatial robot = assetManager.loadModel("Models/robot5.j3o");
robot.scale(1f, 1f, 1f);
robot.rotate(0f,FastMath.PI,0f);
robot.setLocalTranslation(0f,0f,0f);
lighting setup :
DirectionalLight light_dir = new DirectionalLight();
light_dir.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(light_dir);
(clean, build, run)
(program starts, begin to back up, crashes when robot begins to be be visible)
Output :
Building jar: /home/jason/jMonkeyProjects/BasicGame7/build/assets.jar
init:
deps-jar:
Updating property file: /home/jason/jMonkeyProjects/BasicGame7/build/built-jar.properties
Created dir: /home/jason/jMonkeyProjects/BasicGame7/build/classes
Created dir: /home/jason/jMonkeyProjects/BasicGame7/build/empty
Compiling 1 source file to /home/jason/jMonkeyProjects/BasicGame7/build/classes
compile:
run:
Aug 15, 2011 9:07:00 AM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkey Engine 3 Alpha 0.6
Aug 15, 2011 9:07:00 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #1: file:/usr/local/jmonkeyplatform/jmonkeyplatform/libs/
Aug 15, 2011 9:07:00 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #2: /home/jason/jMonkeyProjects/BasicGame7
Aug 15, 2011 9:07:00 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #3: /home/jason/jMonkeyProjects/BasicGame7
Aug 15, 2011 9:07:00 AM com.jme3.system.Natives extractNativeLib
WARNING: Cannot locate native library: linux/libbulletjme.so
Aug 15, 2011 9:07:01 AM com.jme3.system.lwjgl.LwjglAbstractDisplay run
INFO: Using LWJGL 2.7.1
Aug 15, 2011 9:07:01 AM com.jme3.system.lwjgl.LwjglDisplay createContext
INFO: Selected display mode: 1200 x 900 x 0 @0Hz
Aug 15, 2011 9:07:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Adapter: null
Aug 15, 2011 9:07:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Driver Version: null
Aug 15, 2011 9:07:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Vendor: NVIDIA Corporation
Aug 15, 2011 9:07:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: OpenGL Version: 2.1.2 NVIDIA 173.14.22
Aug 15, 2011 9:07:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Renderer: GeForce FX 5200/AGP/SSE2
Aug 15, 2011 9:07:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: GLSL Ver: 1.20 NVIDIA via Cg compiler
Aug 15, 2011 9:07:02 AM com.jme3.system.lwjgl.LwjglTimer
INFO: Timer resolution: 1,000 ticks per second
Aug 15, 2011 9:07:02 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
WARNING: Your graphics card does not support non-power-of-2 textures. Some features might not work.
Aug 15, 2011 9:07:02 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
INFO: Caps: [FrameBuffer, FrameBufferMultisample, OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120]
Aug 15, 2011 9:07:02 AM com.jme3.asset.DesktopAssetManager
INFO: DesktopAssetManager created.
Aug 15, 2011 9:07:02 AM com.jme3.renderer.Camera
INFO: Camera created (W: 1,200, H: 900)
Aug 15, 2011 9:07:02 AM com.jme3.renderer.Camera
INFO: Camera created (W: 1,200, H: 900)
Aug 15, 2011 9:07:02 AM com.jme3.input.lwjgl.LwjglMouseInput initialize
INFO: Mouse created.
Aug 15, 2011 9:07:02 AM com.jme3.input.lwjgl.LwjglKeyInput initialize
INFO: Keyboard created.
Aug 15, 2011 9:07:02 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: AudioRenderer supports 64 channels
Aug 15, 2011 9:07:02 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio effect extension version: 1.0
Aug 15, 2011 9:07:02 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 1
Aug 15, 2011 9:07:02 AM com.jme3.material.MaterialDef
INFO: Loaded material definition: Unshaded
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Gui Node)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (Statistics View) attached to this node (Gui Node)
Aug 15, 2011 9:07:03 AM com.jme3.material.MaterialDef
INFO: Loaded material definition: Phong Lighting
Aug 15, 2011 9:07:03 AM com.jme3.scene.Node attachChild
INFO: Child (robot5-objnode) attached to this node (Root Node)
Aug 15, 2011 9:07:03 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform m_VertexColor is not declared in shader.
Aug 15, 2011 9:07:05 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform g_CameraPosition is not declared in shader.
Aug 15, 2011 9:07:05 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform g_WorldMatrix is not declared in shader.
Aug 15, 2011 9:07:05 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform m_UseMaterialColors is not declared in shader.
Aug 15, 2011 9:07:05 AM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.renderer.RendererException: Shader link failure, shader:Shader[language=GLSL100, numSources=2, numUniforms=15, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment]]] info:Fragment info
(126) : warning C7050: "$temp22" might be used before being initialized
Internal error: assembly compile error for fragment shader at offset 1932:
-- error message --
line 61, column 20: error: invalid operand variable
line 74, column 13: error: invalid operand variable
-- internal assembly text --
!!FP1.0
# cgc version 2.0.0018, build date Nov 8 2009 21:26:53
# command line args:
#vendor NVIDIA Corporation
#version 2.0.1.18
#profile fp30
#program main
#semantic g_LightDirection
#semantic m_AlphaDiscardThreshold
#semantic m_Shininess
#var float2 texCoord : : : -1 : 0
#var float3 AmbientSum : $vin.TEX0 : TEX0 : -1 : 1
#var float4 DiffuseSum : $vin.TEX1 : TEX1 : -1 : 1
#var float3 SpecularSum : $vin.TEX2 : TEX2 : -1 : 1
#var float4 g_LightDirection : : : -1 : 1
#var float3 vPosition : : : -1 : 0
#var float3 vViewDir : $vin.TEX3 : TEX3 : -1 : 1
#var float4 vLightDir : $vin.TEX4 : TEX4 : -1 : 1
#var float3 lightVec : $vin.TEX5 : TEX5 : -1 : 1
#var float3 vNormal : $vin.TEX6 : TEX6 : -1 : 1
#var float m_AlphaDiscardThreshold : : : -1 : 1
#var float m_Shininess : : : -1 : 1
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var 4 $kill_0000 : $vout.$kill : $kill : -1 : 0
DECLARE m_AlphaDiscardThreshold;
DECLARE g_LightDirection;
DECLARE m_Shininess;
DP3R R0.y, g_LightDirection, g_LightDirection;
RSQR R0.y, R0.y;
DP3R R0.x, f[TEX5], f[TEX5];
MULR R1.xyz, R0.y, g_LightDirection;
RSQR R0.x, R0.x;
MULR R0.xyz, R0.x, f[TEX5];
DP3R R0.x, -R0, R1;
MOVR R1.w, {0, 0, 0, 0}.x;
FRCR R0.y, g_LightDirection.w;
FLRR R0.z, g_LightDirection.w;
MADR R0.z, R0, {0.001, 0, 0, 0}.x, -R0.y;
ADDR R0.y, R0.x, -R0;
MOVR R0.x, {1, 0, 0, 0};
RCPR R0.z, R0.z;
MOVXC RC.x, g_LightDirection.w;
MULR R0.x(NE), R0.y, R0.z;
SLER H0.z, R0.x, {0, 0, 0, 0}.x;
MOVR R0.y, {0, 0, 0, 0}.x;
SNER H0.y, g_LightDirection.w, R0;
SEQX H0.x, H0.z, {0, 0, 0, 0};
MULXC HC.x, H0.y, H0;
MOVR R0.w, R0.x;
MOVR_SAT R0.w(NE.x), R0.x;
DP3R R0.y, f[TEX4], f[TEX4];
RSQR R0.y, R0.y;
MULR R1.xyz, R0.y, f[TEX4];
MOVX H0.x, {0, 0, 0, 0};
MULXC HC.y, H0, H0.z;
MOVR R0.x, {1, 0, 0, 0};
SLER H0.y, m_Shininess.x, R0.x;
MOVH H0.x(EQ.y), {1, 0, 0, 0};
MULXC HC.x, H0, H0.y;
MOVX H0.y, {0, 0, 0, 0}.x;
MOVR o[COLR].xyz, o[COLR];
DP3R R0.x, f[TEX6], f[TEX6];
RSQR R0.x, R0.x;
MOVR R1.w(EQ.x), R2.x;
MULR R0.xyz, R0.x, f[TEX6];
DP3R R2.x, R0, R1;
MOVH H0.y(EQ.x), {1, 0, 0, 0}.x;
MULR R0.xyz, -R2.x, R0;
MADR R0.xyz, -R0, {2, 0, 0, 0}.x, -R1;
DP3R R0.x, R0, f[TEX3];
MAXR R0.x, R0, {0, 0, 0, 0};
MULXC HC.x, H0, H0.y;
POWR R1.w(NE.x), R0.x, m_Shininess.x;
MOVR R0.x, o[COLR].w;
MAXR R1.x, R2, {0, 0, 0, 0};
MULR R1.y, R1.x, R1.w;
MULR R1.xy, R1, f[TEX4].w;
MULR R0.zw, R1.xyxy, R0.w;
MULR R1.xyz, f[TEX1], R0.z;
MOVXC RC.x, H0;
MOVR R0.y, f[TEX1].w;
MOVR R0.x(NE.y), f[TEX1].w;
MOVR R0.y(EQ.x), R0.x;
MOVR o[COLR].xyz(NE.y), f[TEX0];
ADDR R1.xyz, R1, f[TEX0];
MADR o[COLR].xyz(NE.x), f[TEX2], R0.w, R1;
SLTRC HC.x, f[TEX1].w, m_AlphaDiscardThreshold;
KIL NE.x;
MOVR o[COLR].w, R0.y;
END
# 62 instructions, 3 R-regs, 1 H-regs
at com.jme3.renderer.lwjgl.LwjglRenderer.updateShaderData(LwjglRenderer.java:1108)
at com.jme3.renderer.lwjgl.LwjglRenderer.setShader(LwjglRenderer.java:1143)
at com.jme3.material.Material.renderMultipassLighting(Material.java:782)
at com.jme3.material.Material.render(Material.java:1009)
at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:656)
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:301)
at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:363)
at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:912)
at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:849)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1125)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1162)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:264)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)
at java.lang.Thread.run(Thread.java:636)
BUILD SUCCESSFUL (total time: 6 seconds)

END TEST 2

Test 3
Perhaps its the model, so I make a new blender model. It is a cube with a pink material. I load the .obj file.
spatial setup :
Spatial robot = assetManager.loadModel("Models/myCube.obj");
robot.scale(1f, 1f, 1f);
robot.rotate(0f,FastMath.PI,0f);
robot.setLocalTranslation(0f,0f,0f);
lighting setup :
DirectionalLight light_dir = new DirectionalLight();
light_dir.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(light_dir);
(clean, build, run, begin to back up, crash)
Output :
Building jar: /home/jason/jMonkeyProjects/BasicGame7/build/assets.jar
init:
deps-jar:
Updating property file: /home/jason/jMonkeyProjects/BasicGame7/build/built-jar.properties
Created dir: /home/jason/jMonkeyProjects/BasicGame7/build/classes
Created dir: /home/jason/jMonkeyProjects/BasicGame7/build/empty
Compiling 1 source file to /home/jason/jMonkeyProjects/BasicGame7/build/classes
compile:
run:
Aug 15, 2011 9:22:00 AM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkey Engine 3 Alpha 0.6
Aug 15, 2011 9:22:00 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #1: file:/usr/local/jmonkeyplatform/jmonkeyplatform/libs/
Aug 15, 2011 9:22:00 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #2: /home/jason/jMonkeyProjects/BasicGame7
Aug 15, 2011 9:22:00 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #3: /home/jason/jMonkeyProjects/BasicGame7
Aug 15, 2011 9:22:00 AM com.jme3.system.Natives extractNativeLib
WARNING: Cannot locate native library: linux/libbulletjme.so
Aug 15, 2011 9:22:01 AM com.jme3.system.lwjgl.LwjglAbstractDisplay run
INFO: Using LWJGL 2.7.1
Aug 15, 2011 9:22:01 AM com.jme3.system.lwjgl.LwjglDisplay createContext
INFO: Selected display mode: 1200 x 900 x 0 @0Hz
Aug 15, 2011 9:22:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Adapter: null
Aug 15, 2011 9:22:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Driver Version: null
Aug 15, 2011 9:22:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Vendor: NVIDIA Corporation
Aug 15, 2011 9:22:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: OpenGL Version: 2.1.2 NVIDIA 173.14.22
Aug 15, 2011 9:22:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Renderer: GeForce FX 5200/AGP/SSE2
Aug 15, 2011 9:22:02 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: GLSL Ver: 1.20 NVIDIA via Cg compiler
Aug 15, 2011 9:22:02 AM com.jme3.system.lwjgl.LwjglTimer
INFO: Timer resolution: 1,000 ticks per second
Aug 15, 2011 9:22:02 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
WARNING: Your graphics card does not support non-power-of-2 textures. Some features might not work.
Aug 15, 2011 9:22:02 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
INFO: Caps: [FrameBuffer, FrameBufferMultisample, OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120]
Aug 15, 2011 9:22:03 AM com.jme3.asset.DesktopAssetManager
INFO: DesktopAssetManager created.
Aug 15, 2011 9:22:03 AM com.jme3.renderer.Camera
INFO: Camera created (W: 1,200, H: 900)
Aug 15, 2011 9:22:03 AM com.jme3.renderer.Camera
INFO: Camera created (W: 1,200, H: 900)
Aug 15, 2011 9:22:03 AM com.jme3.input.lwjgl.LwjglMouseInput initialize
INFO: Mouse created.
Aug 15, 2011 9:22:03 AM com.jme3.input.lwjgl.LwjglKeyInput initialize
INFO: Keyboard created.
Aug 15, 2011 9:22:03 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: AudioRenderer supports 64 channels
Aug 15, 2011 9:22:03 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio effect extension version: 1.0
Aug 15, 2011 9:22:03 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 1
Aug 15, 2011 9:22:03 AM com.jme3.material.MaterialDef
INFO: Loaded material definition: Unshaded
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Gui Node)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (Statistics View) attached to this node (Gui Node)
Aug 15, 2011 9:22:04 AM com.jme3.material.MaterialDef
INFO: Loaded material definition: Phong Lighting
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader readLine
WARNING: Unknown statement in OBJ! o
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader createGeometry
WARNING: OBJ mesh robot5-geom-0 doesnt contain normals! It might not display correctly
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (robot5-geom-0) attached to this node (robot5-objnode)
Aug 15, 2011 9:22:04 AM com.jme3.scene.plugins.OBJLoader createGeometry
WARNING: OBJ mesh robot5-geom-1 doesnt contain normals! It might not display correctly
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (robot5-geom-1) attached to this node (robot5-objnode)
Aug 15, 2011 9:22:04 AM com.jme3.scene.Node attachChild
INFO: Child (robot5-objnode) attached to this node (Root Node)
Aug 15, 2011 9:22:05 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform m_VertexColor is not declared in shader.
Aug 15, 2011 9:22:08 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform g_CameraPosition is not declared in shader.
Aug 15, 2011 9:22:08 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform g_WorldMatrix is not declared in shader.
Aug 15, 2011 9:22:08 AM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform m_UseMaterialColors is not declared in shader.
Aug 15, 2011 9:22:08 AM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.renderer.RendererException: Shader link failure, shader:Shader[language=GLSL100, numSources=2, numUniforms=15, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment]]] info:Fragment info
(126) : warning C7050: "$temp22" might be used before being initialized
Internal error: assembly compile error for fragment shader at offset 1932:
-- error message --
line 61, column 20: error: invalid operand variable
line 74, column 13: error: invalid operand variable
-- internal assembly text --
!!FP1.0
# cgc version 2.0.0018, build date Nov 8 2009 21:26:53
# command line args:
#vendor NVIDIA Corporation
#version 2.0.1.18
#profile fp30
#program main
#semantic g_LightDirection
#semantic m_AlphaDiscardThreshold
#semantic m_Shininess
#var float2 texCoord : : : -1 : 0
#var float3 AmbientSum : $vin.TEX0 : TEX0 : -1 : 1
#var float4 DiffuseSum : $vin.TEX1 : TEX1 : -1 : 1
#var float3 SpecularSum : $vin.TEX2 : TEX2 : -1 : 1
#var float4 g_LightDirection : : : -1 : 1
#var float3 vPosition : : : -1 : 0
#var float3 vViewDir : $vin.TEX3 : TEX3 : -1 : 1
#var float4 vLightDir : $vin.TEX4 : TEX4 : -1 : 1
#var float3 lightVec : $vin.TEX5 : TEX5 : -1 : 1
#var float3 vNormal : $vin.TEX6 : TEX6 : -1 : 1
#var float m_AlphaDiscardThreshold : : : -1 : 1
#var float m_Shininess : : : -1 : 1
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var 4 $kill_0000 : $vout.$kill : $kill : -1 : 0
DECLARE m_AlphaDiscardThreshold;
DECLARE g_LightDirection;
DECLARE m_Shininess;
DP3R R0.y, g_LightDirection, g_LightDirection;
RSQR R0.y, R0.y;
DP3R R0.x, f[TEX5], f[TEX5];
MULR R1.xyz, R0.y, g_LightDirection;
RSQR R0.x, R0.x;
MULR R0.xyz, R0.x, f[TEX5];
DP3R R0.x, -R0, R1;
MOVR R1.w, {0, 0, 0, 0}.x;
FRCR R0.y, g_LightDirection.w;
FLRR R0.z, g_LightDirection.w;
MADR R0.z, R0, {0.001, 0, 0, 0}.x, -R0.y;
ADDR R0.y, R0.x, -R0;
MOVR R0.x, {1, 0, 0, 0};
RCPR R0.z, R0.z;
MOVXC RC.x, g_LightDirection.w;
MULR R0.x(NE), R0.y, R0.z;
SLER H0.z, R0.x, {0, 0, 0, 0}.x;
MOVR R0.y, {0, 0, 0, 0}.x;
SNER H0.y, g_LightDirection.w, R0;
SEQX H0.x, H0.z, {0, 0, 0, 0};
MULXC HC.x, H0.y, H0;
MOVR R0.w, R0.x;
MOVR_SAT R0.w(NE.x), R0.x;
DP3R R0.y, f[TEX4], f[TEX4];
RSQR R0.y, R0.y;
MULR R1.xyz, R0.y, f[TEX4];
MOVX H0.x, {0, 0, 0, 0};
MULXC HC.y, H0, H0.z;
MOVR R0.x, {1, 0, 0, 0};
SLER H0.y, m_Shininess.x, R0.x;
MOVH H0.x(EQ.y), {1, 0, 0, 0};
MULXC HC.x, H0, H0.y;
MOVX H0.y, {0, 0, 0, 0}.x;
MOVR o[COLR].xyz, o[COLR];
DP3R R0.x, f[TEX6], f[TEX6];
RSQR R0.x, R0.x;
MOVR R1.w(EQ.x), R2.x;
MULR R0.xyz, R0.x, f[TEX6];
DP3R R2.x, R0, R1;
MOVH H0.y(EQ.x), {1, 0, 0, 0}.x;
MULR R0.xyz, -R2.x, R0;
MADR R0.xyz, -R0, {2, 0, 0, 0}.x, -R1;
DP3R R0.x, R0, f[TEX3];
MAXR R0.x, R0, {0, 0, 0, 0};
MULXC HC.x, H0, H0.y;
POWR R1.w(NE.x), R0.x, m_Shininess.x;
MOVR R0.x, o[COLR].w;
MAXR R1.x, R2, {0, 0, 0, 0};
MULR R1.y, R1.x, R1.w;
MULR R1.xy, R1, f[TEX4].w;
MULR R0.zw, R1.xyxy, R0.w;
MULR R1.xyz, f[TEX1], R0.z;
MOVXC RC.x, H0;
MOVR R0.y, f[TEX1].w;
MOVR R0.x(NE.y), f[TEX1].w;
MOVR R0.y(EQ.x), R0.x;
MOVR o[COLR].xyz(NE.y), f[TEX0];
ADDR R1.xyz, R1, f[TEX0];
MADR o[COLR].xyz(NE.x), f[TEX2], R0.w, R1;
SLTRC HC.x, f[TEX1].w, m_AlphaDiscardThreshold;
KIL NE.x;
MOVR o[COLR].w, R0.y;
END
# 62 instructions, 3 R-regs, 1 H-regs
at com.jme3.renderer.lwjgl.LwjglRenderer.updateShaderData(LwjglRenderer.java:1108)
at com.jme3.renderer.lwjgl.LwjglRenderer.setShader(LwjglRenderer.java:1143)
at com.jme3.material.Material.renderMultipassLighting(Material.java:782)
at com.jme3.material.Material.render(Material.java:1009)
at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:656)
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:301)
at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:363)
at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:912)
at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:849)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1125)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1162)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:264)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)
at java.lang.Thread.run(Thread.java:636)
BUILD SUCCESSFUL (total time: 10 seconds)

END TEST 3

Test 4
Same as test 3, but I load the cube after converting it to .j3o.
Spatial setup :
Spatial robot = assetManager.loadModel("Models/myCube.j3o");
robot.scale(1f, 1f, 1f);
robot.rotate(0f,FastMath.PI,0f);
robot.setLocalTranslation(0f,0f,0f);
Lighting setup :
DirectionalLight light_dir = new DirectionalLight();
light_dir.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(light_dir);
(clean, build, run, begin to back up, insta crash)
(note : I think its insta crash because the model is visible before you back up some)
Output :
Building jar: /home/jason/jMonkeyProjects/BasicGame7/build/assets.jar
init:
deps-jar:
Updating property file: /home/jason/jMonkeyProjects/BasicGame7/build/built-jar.properties
Created dir: /home/jason/jMonkeyProjects/BasicGame7/build/classes
Created dir: /home/jason/jMonkeyProjects/BasicGame7/build/empty
Compiling 1 source file to /home/jason/jMonkeyProjects/BasicGame7/build/classes
compile:
run:
Aug 15, 2011 9:26:16 AM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkey Engine 3 Alpha 0.6
Aug 15, 2011 9:26:16 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #1: file:/usr/local/jmonkeyplatform/jmonkeyplatform/libs/
Aug 15, 2011 9:26:16 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #2: /home/jason/jMonkeyProjects/BasicGame7
Aug 15, 2011 9:26:16 AM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory #3: /home/jason/jMonkeyProjects/BasicGame7
Aug 15, 2011 9:26:16 AM com.jme3.system.Natives extractNativeLib
WARNING: Cannot locate native library: linux/libbulletjme.so
Aug 15, 2011 9:26:16 AM com.jme3.system.lwjgl.LwjglAbstractDisplay run
INFO: Using LWJGL 2.7.1
Aug 15, 2011 9:26:16 AM com.jme3.system.lwjgl.LwjglDisplay createContext
INFO: Selected display mode: 1200 x 900 x 0 @0Hz
Aug 15, 2011 9:26:17 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Adapter: null
Aug 15, 2011 9:26:17 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Driver Version: null
Aug 15, 2011 9:26:17 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Vendor: NVIDIA Corporation
Aug 15, 2011 9:26:17 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: OpenGL Version: 2.1.2 NVIDIA 173.14.22
Aug 15, 2011 9:26:17 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Renderer: GeForce FX 5200/AGP/SSE2
Aug 15, 2011 9:26:17 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: GLSL Ver: 1.20 NVIDIA via Cg compiler
Aug 15, 2011 9:26:17 AM com.jme3.system.lwjgl.LwjglTimer
INFO: Timer resolution: 1,000 ticks per second
Aug 15, 2011 9:26:17 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
WARNING: Your graphics card does not support non-power-of-2 textures. Some features might not work.
Aug 15, 2011 9:26:17 AM com.jme3.renderer.lwjgl.LwjglRenderer initialize
INFO: Caps: [FrameBuffer, FrameBufferMultisample, OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120]
Aug 15, 2011 9:26:18 AM com.jme3.asset.DesktopAssetManager
INFO: DesktopAssetManager created.
Aug 15, 2011 9:26:18 AM com.jme3.renderer.Camera
INFO: Camera created (W: 1,200, H: 900)
Aug 15, 2011 9:26:18 AM com.jme3.renderer.Camera
INFO: Camera created (W: 1,200, H: 900)
Aug 15, 2011 9:26:18 AM com.jme3.input.lwjgl.LwjglMouseInput initialize
INFO: Mouse created.
Aug 15, 2011 9:26:18 AM com.jme3.input.lwjgl.LwjglKeyInput initialize
INFO: Keyboard created.
Aug 15, 2011 9:26:18 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: AudioRenderer supports 64 channels
Aug 15, 2011 9:26:18 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio effect extension version: 1.0
Aug 15, 2011 9:26:18 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 1
Aug 15, 2011 9:26:18 AM com.jme3.material.MaterialDef
INFO: Loaded material definition: Unshaded
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Gui Node)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (Statistics View) attached to this node (Gui Node)
Aug 15, 2011 9:26:18 AM com.jme3.material.MaterialDef
INFO: Loaded material definition: Phong Lighting
Aug 15, 2011 9:26:18 AM com.jme3.scene.Node attachChild
INFO: Child (myCube-geom-0) attached to this node (Root Node)
Aug 15, 2011 9:26:19 AM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.renderer.RendererException: Shader link failure, shader:Shader[language=GLSL100, numSources=2, numUniforms=15, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment]]] info:Fragment info
(126) : warning C7050: "$temp22" might be used before being initialized
Internal error: assembly compile error for fragment shader at offset 1932:
-- error message --
line 61, column 20: error: invalid operand variable
line 74, column 13: error: invalid operand variable
-- internal assembly text --
!!FP1.0
# cgc version 2.0.0018, build date Nov 8 2009 21:26:53
# command line args:
#vendor NVIDIA Corporation
#version 2.0.1.18
#profile fp30
#program main
#semantic g_LightDirection
#semantic m_AlphaDiscardThreshold
#semantic m_Shininess
#var float2 texCoord : : : -1 : 0
#var float3 AmbientSum : $vin.TEX0 : TEX0 : -1 : 1
#var float4 DiffuseSum : $vin.TEX1 : TEX1 : -1 : 1
#var float3 SpecularSum : $vin.TEX2 : TEX2 : -1 : 1
#var float4 g_LightDirection : : : -1 : 1
#var float3 vPosition : : : -1 : 0
#var float3 vViewDir : $vin.TEX3 : TEX3 : -1 : 1
#var float4 vLightDir : $vin.TEX4 : TEX4 : -1 : 1
#var float3 lightVec : $vin.TEX5 : TEX5 : -1 : 1
#var float3 vNormal : $vin.TEX6 : TEX6 : -1 : 1
#var float m_AlphaDiscardThreshold : : : -1 : 1
#var float m_Shininess : : : -1 : 1
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var 4 $kill_0000 : $vout.$kill : $kill : -1 : 0
DECLARE m_AlphaDiscardThreshold;
DECLARE g_LightDirection;
DECLARE m_Shininess;
DP3R R0.y, g_LightDirection, g_LightDirection;
RSQR R0.y, R0.y;
DP3R R0.x, f[TEX5], f[TEX5];
MULR R1.xyz, R0.y, g_LightDirection;
RSQR R0.x, R0.x;
MULR R0.xyz, R0.x, f[TEX5];
DP3R R0.x, -R0, R1;
MOVR R1.w, {0, 0, 0, 0}.x;
FRCR R0.y, g_LightDirection.w;
FLRR R0.z, g_LightDirection.w;
MADR R0.z, R0, {0.001, 0, 0, 0}.x, -R0.y;
ADDR R0.y, R0.x, -R0;
MOVR R0.x, {1, 0, 0, 0};
RCPR R0.z, R0.z;
MOVXC RC.x, g_LightDirection.w;
MULR R0.x(NE), R0.y, R0.z;
SLER H0.z, R0.x, {0, 0, 0, 0}.x;
MOVR R0.y, {0, 0, 0, 0}.x;
SNER H0.y, g_LightDirection.w, R0;
SEQX H0.x, H0.z, {0, 0, 0, 0};
MULXC HC.x, H0.y, H0;
MOVR R0.w, R0.x;
MOVR_SAT R0.w(NE.x), R0.x;
DP3R R0.y, f[TEX4], f[TEX4];
RSQR R0.y, R0.y;
MULR R1.xyz, R0.y, f[TEX4];
MOVX H0.x, {0, 0, 0, 0};
MULXC HC.y, H0, H0.z;
MOVR R0.x, {1, 0, 0, 0};
SLER H0.y, m_Shininess.x, R0.x;
MOVH H0.x(EQ.y), {1, 0, 0, 0};
MULXC HC.x, H0, H0.y;
MOVX H0.y, {0, 0, 0, 0}.x;
MOVR o[COLR].xyz, o[COLR];
DP3R R0.x, f[TEX6], f[TEX6];
RSQR R0.x, R0.x;
MOVR R1.w(EQ.x), R2.x;
MULR R0.xyz, R0.x, f[TEX6];
DP3R R2.x, R0, R1;
MOVH H0.y(EQ.x), {1, 0, 0, 0}.x;
MULR R0.xyz, -R2.x, R0;
MADR R0.xyz, -R0, {2, 0, 0, 0}.x, -R1;
DP3R R0.x, R0, f[TEX3];
MAXR R0.x, R0, {0, 0, 0, 0};
MULXC HC.x, H0, H0.y;
POWR R1.w(NE.x), R0.x, m_Shininess.x;
MOVR R0.x, o[COLR].w;
MAXR R1.x, R2, {0, 0, 0, 0};
MULR R1.y, R1.x, R1.w;
MULR R1.xy, R1, f[TEX4].w;
MULR R0.zw, R1.xyxy, R0.w;
MULR R1.xyz, f[TEX1], R0.z;
MOVXC RC.x, H0;
MOVR R0.y, f[TEX1].w;
MOVR R0.x(NE.y), f[TEX1].w;
MOVR R0.y(EQ.x), R0.x;
MOVR o[COLR].xyz(NE.y), f[TEX0];
ADDR R1.xyz, R1, f[TEX0];
MADR o[COLR].xyz(NE.x), f[TEX2], R0.w, R1;
SLTRC HC.x, f[TEX1].w, m_AlphaDiscardThreshold;
KIL NE.x;
MOVR o[COLR].w, R0.y;
END
# 62 instructions, 3 R-regs, 1 H-regs
at com.jme3.renderer.lwjgl.LwjglRenderer.updateShaderData(LwjglRenderer.java:1108)
at com.jme3.renderer.lwjgl.LwjglRenderer.setShader(LwjglRenderer.java:1143)
at com.jme3.material.Material.renderMultipassLighting(Material.java:782)
at com.jme3.material.Material.render(Material.java:1009)
at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:656)
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:301)
at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:363)
at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:912)
at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:849)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1125)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1162)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:264)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)
at java.lang.Thread.run(Thread.java:636)
BUILD SUCCESSFUL (total time: 5 seconds)

END TEST 4

Test 5
What happens if I load myCube.j3o and manually set the material?
Setup :
Spatial robot = assetManager.loadModel("Models/myCube.j3o");
robot.scale(1f, 1f, 1f);
robot.rotate(0f,FastMath.PI,0f);
robot.setLocalTranslation(0f,0f,0f);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
robot.setMaterial(mat);
rootNode.attachChild(robot);
DirectionalLight light_dir = new DirectionalLight();
light_dir.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(light_dir);
(clean, build, run)
Result :
Untextured, white cube.

END TEST 5

Test 6 :
What happens if I set the material to the .mat file when loading the .obj? (I thought loading the model took care of loading the material automagically, but Im currious how this will turn out anyway)
Setup :
Spatial robot = assetManager.loadModel("Models/myCube.obj");
robot.scale(1f, 1f, 1f);
robot.rotate(0f,FastMath.PI,0f);
robot.setLocalTranslation(0f,0f,0f);
Material mat = new Material(assetManager, "Models/myCube.mtl");
robot.setMaterial(mat);
rootNode.attachChild(robot);
Output :
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.ClassCastException: com.jme3.material.MaterialList cannot be cast to com.jme3.material.MaterialDef
(aparently, .mtl is a MaterialList)

END TEST 6


----SOURCE CODE

[java]package mygame;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.math.FastMath;
import com.jme3.system.AppSettings;
import com.jme3.light.*;
/**
* test
* @author normenhansen //HI NORMEN!
*/
public class Main extends SimpleApplication {
public static void main(String[] args) {
AppSettings settings = new AppSettings(true);//leave this true
settings.setResolution(1200,900);
settings.setTitle("Hi there");
Main app = new Main();
app.setSettings(settings);
app.setShowSettings(false);
app.start();
}
@Override
public void simpleInitApp() {
viewPort.setBackgroundColor(ColorRGBA.Blue);
Spatial robot = assetManager.loadModel("Models/robot5.j3o");
robot.scale(1f, 1f, 1f);
robot.rotate(0f,FastMath.PI,0f);
//robot.setLocalTranslation(0f,-30f,-60f);
robot.setLocalTranslation(0f,0f,0f);
//Material mat = new Material(assetManager, "Models/target.mtl");
//Material mat = new Material(
// assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
//mat.setTexture("ColorMap",
// assetManager.loadTexture("Textures/bluetiles1.jpg"));
//disc.setMaterial(mat);
rootNode.attachChild(robot);
DirectionalLight light_dir = new DirectionalLight();
light_dir.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(light_dir);
//AmbientLight light_amb = new AmbientLight();
//rootNode.addLight(light_amb);
flyCam.setMoveSpeed(70);
}
@Override
public void simpleUpdate(float tpf) {
//TODO: add update code
}
@Override
public void simpleRender(RenderManager rm) {
//TODO: add render code
}
}[/java]

myCube.obj


Blender v2.58 (sub 1) OBJ File: ‘’

www.blender.org

mtllib myCube.mtl

o Cube

v 1.000000 -1.000000 -1.000000

v 1.000000 -1.000000 1.000000

v -1.000000 -1.000000 1.000000

v -1.000000 -1.000000 -1.000000

v 1.000000 1.000000 -0.999999

v 0.999999 1.000000 1.000001

v -1.000000 1.000000 1.000000

v -1.000000 1.000000 -1.000000

usemtl Material

s off

f 1 2 3 4

f 5 8 7 6

f 1 5 6 2

f 2 6 7 3

f 3 7 8 4

f 5 1 4 8







myCube.mtl


Blender MTL File: ‘’

Material Count: 1

newmtl Material

Ns 96.078431

Ka 0.000000 0.000000 0.000000

Kd 0.640000 0.153525 0.161674

Ks 0.500000 0.500000 0.500000

Ni 1.000000

d 1.000000

illum 2

Regarding : “… doesnt contain normals! It might not display correctly”



According to http://en.wikipedia.org/wiki/Wavefront_.obj_file we need vertex normals in the .obj file. So I went back into blender, export as .obj, and checked ‘Normals’. (default is unchecked)



My .obj file now :


Blender v2.58 (sub 1) OBJ File: ‘’

www.blender.org

mtllib myCube2.mtl

o Cube

v 1.000000 -1.000000 -1.000000

v 1.000000 -1.000000 1.000000

v -1.000000 -1.000000 1.000000

v -1.000000 -1.000000 -1.000000

v 1.000000 1.000000 -0.999999

v 0.999999 1.000000 1.000001

v -1.000000 1.000000 1.000000

v -1.000000 1.000000 -1.000000

vn 0.000000 -1.000000 0.000000

vn 0.000000 1.000000 0.000000

vn 1.000000 0.000000 0.000000

vn -0.000000 -0.000000 1.000000

vn -1.000000 -0.000000 -0.000000

vn 0.000000 0.000000 -1.000000

usemtl Material

s off

f 1//1 2//1 3//1 4//1

f 5//2 8//2 7//2 6//2

f 1//3 5//3 6//3 2//3

f 2//4 6//4 7//4 3//4

f 3//5 7//5 8//5 4//5

f 5//6 1//6 4//6 8//6





I still get :

WARNING: Unknown statement in OBJ! o



and



WARNING: OBJ mesh myCube2-geom-0 doesnt contain normals! It might not display correctly



and



SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

com.jme3.renderer.RendererException: Shader link failure, shader:Shader[language=GLSL100, numSources=2, numUniforms=15, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment]]] info:Fragment info


(126) : warning C7050: "$temp22" might be used before being initialized
Internal error: assembly compile error for fragment shader at offset 1932:

The warning regarding the normals was fixed (it was displaying even if everything was fine). As for the last error, it looks like a driver issue so I recommend updating drivers

“updating drivers”





I suspect quite a few of my issues are driver related. Developing on a 10 year old system with a crappy video card (old Nvidia PCI card) using ubuntu with dual monitors = I had to do some funky things with the drivers. What fun is it if you dont have to dive into assembly now and than? :slight_smile: