Hi all, I’ve been stuck for about a week now trying to create a simple cube with a normalmap and have it display properly in JME3. I’m fairly new to both Blender and JME3, but I’ve followed three different video tutorials for UV-unwrapping a cube, creating a normalmap for it, then applying the normalmap and successfully rendering the cube in Blender.
When I bring everything over to JME3 though, it just goes haywire. At first the entire cube was turning black when I added a normal to the material. Now it’s a little better – two sides of the cube show a correct normalmap, while the other four are blank (and the object appears to ignore all ambient light, but that’s a secondary concern). I’ve gotten better results using code-generated primitive shapes, but I want to get it working perfectly with a Blender-created shape so I can do more complicated models later on.
Any help would be highly appreciated! Here’s the files involved in this ongoing travesty of mine:
.blend cube, which I converted into a .j3o – dropbox link
texture PNG file, which I generated from a UV-unwrapping + baked normalmap tutorial thing – dropbox link
material I created in JME3, has that texture as the normalmap – dropbox link
Here’s the entirety of my code:
public void simpleInitApp() {
Spatial geom = assetManager.loadModel(“Models/normalCube.j3o”);
TangentBinormalGenerator.generate(geom);
geom.setMaterial(assetManager.loadMaterial(“Materials/testMaterial.j3m”));
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(1,1,-2).normalizeLocal());
sun.setColor(ColorRGBA.White);
rootNode.attachChild(geom);
rootNode.addLight(sun);
}
And here’s a picture of what it looks like when I run the program; as you can see, one of the sides is fine, but the other is just blank.
And here’s what it looks like in Blender, all nice and normal-mapped everywhere it ought to be, with the now-visible face expressing my current emotions.
Any ideas? =) Thanks!