Hi guys, I have been struggling for weeks with this texture problem and am still unable to solve it. From 3ds max I have created and UV mapped a model, according to jme3, this 3ds max object and material is to be exported to jme3 via blender. To get to blender I used the .obj + .mat formats, to export to jme3 I used the ogretoblender addon. This left me with two files: house.mesh.xml and blendertoogre.material, these I put together in a folder called ‘/house’ within my ‘Assets > Models’ folder. With these two files I also added the image texture file called ‘houseimg.jpg’. All as per JME3 guidance.
Below is my jme3 source code, when ran with the file structure above, the program launches, a blue square loads, my model loads but my model is red and has lost its original exported material. Why is this happening?
Even stranger, the jme3 guidance says that I should rename the material file the same as the model name (house.mesh.xml & house.material), but when this is changed the program launches, shuts down and spits out the error message at the bottom of this post, I hate giving things up, but jme3, blendertoogre or my own stupidity is really starting to piss me off. I was hoping somebody could tell me where Im going wrong? Thanks.
///SETUP
Win XP - sp3
3ds max 9
blender 2.68
jme3
Nvidia Geforce FX5200
…Dunno what else is important?
///SOURCE CODE
package HelloAssets;
import com.jme3.app.SimpleApplication;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;
public class HelloAssets extends SimpleApplication {
public static void main(String[] args){
HelloAssets app = new HelloAssets();
app.start();
}
@Override
public void simpleInitApp(){
Box box1 = new Box(1,1,1);
Geometry blue = new Geometry("Box", box1);
blue.setLocalTranslation(new Vector3f(1,-1,1));
Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat1.setColor("Color", ColorRGBA.Blue);
blue.setMaterial(mat1);
rootNode.attachChild(blue);
Spatial env = assetManager.loadModel("Models/house/house.mesh.xml");
env.setLocalTranslation(0.0f, 0.0f, 0.0f);
env.scale(0.1f, 0.1f, 0.1f);
rootNode.attachChild(env);
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(20.0f, 20.0f, 20.0f));
rootNode.addLight(sun);
}
}
/// ERROR MESSGE
run:
Sep 19, 2003 5:19:15 AM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.0.5
Sep 19, 2003 5:19:15 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Lwjgl 2.9.0 context running on thread LWJGL Renderer Thread
Sep 19, 2003 5:19:15 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Adapter: nv4_disp
Sep 19, 2003 5:19:15 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Driver Version: 6.14.10.8421
Sep 19, 2003 5:19:15 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Vendor: NVIDIA Corporation
Sep 19, 2003 5:19:15 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: OpenGL Version: 2.0.1
Sep 19, 2003 5:19:15 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Renderer: GeForce FX 5200/AGP/SSE2
Sep 19, 2003 5:19:15 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: GLSL Ver: 1.10 NVIDIA via Cg 1.3 compiler
Sep 19, 2003 5:19: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.
Sep 19, 2003 5:19:16 AM com.jme3.asset.AssetConfig loadText
WARNING: Cannot find loader com.jme3.scene.plugins.blender.BlenderModelLoader
Sep 19, 2003 5:19:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio Device: OpenAL Soft
Sep 19, 2003 5:19:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio Vendor: OpenAL Community
Sep 19, 2003 5:19:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio Renderer: OpenAL Soft
Sep 19, 2003 5:19:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio Version: 1.1 ALSOFT 1.15.1
Sep 19, 2003 5:19:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: AudioRenderer supports 64 channels
Sep 19, 2003 5:19:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio effect extension version: 1.0
Sep 19, 2003 5:19:16 AM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 4
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: alpha_to_coverage
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: colour_write
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: depth_check
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: depth_func
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: depth_write
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: illumination_stage
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: light_clip_planes
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: light_scissor
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: normalise_normals
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: polygon_mode
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: scene_blend_op
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: shading
Sep 19, 2003 5:19:16 AM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: transparent_sorting
Sep 19, 2003 5:19:17 AM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: scale
Sep 19, 2003 5:19:17 AM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
Sep 19, 2003 5:19:18 AM com.jme3.renderer.lwjgl.LwjglRenderer updateShaderSourceData
WARNING: Bad compile of:
1 #define DIFFUSEMAP 1
2 #define MATERIAL_COLORS 1
3 #if (defined(PARALLAXMAP) || (defined(NORMALMAP_PARALLAX) && defined(NORMALMAP))) && !defined(VERTEX_LIGHTING)
4 vec2 steepParallaxOffset(sampler2D parallaxMap, vec3 vViewDir,vec2 texCoord,float parallaxScale){
5 vec2 vParallaxDirection = normalize( vViewDir.xy );
6
7 // The length of this vector determines the furthest amount of displacement: (Ati’s comment)
8 float fLength = length( vViewDir );
9 float fParallaxLength = sqrt( fLength * fLength - vViewDir.z * vViewDir.z ) / vViewDir.z;
10
11 // Compute the actual reverse parallax displacement vector: (Ati’s comment)
12 vec2 vParallaxOffsetTS = vParallaxDirection * fParallaxLength;
13
14 // Need to scale the amount of displacemen