Blender models, spatials and textures

Hi all

So I built a model in blender, but adding a texture doesn’t seem to work. When I used a heightmap it worked fine but not on the spatial that the blender model is.

The texture is tiny and is this:

It should look like a red grid on white. But, ts just all red:

The odd thing is if I use a different texture the colour is different - like this texture gives me a tan colour!


Any ideas? This is my code:

public GameEnvironment(AssetManager assetManager, BulletAppState bulletAppState) {
    mat_terrain = new Material(assetManager, "Common/MatDefs/Terrain/Terrain.j3md");
    mat_terrain.setTexture("Alpha", assetManager.loadTexture("Textures/alphamap.png"));

     * Add grid texture into the blue layer (Tex3)
    Texture surfaceTexture = assetManager.loadTexture("Textures/grid8.png");
    mat_terrain.setTexture("Tex3", surfaceTexture);
    mat_terrain.setFloat("Tex3Scale", 2048f);

    Spatial terrain = assetManager.loadModel("Scenes/untitled.blend");


    /* make terrain solid */
    CollisionShape sceneShape = CollisionShapeFactory.createMeshShape(environment);
    landscape = new RigidBodyControl(sceneShape, 0);


The blender model has to have the texture as an UV map (just like here). Make sure you have it well configured (if you pack the textures in the .blend you should see it great when just loading, wtithout the need to specify the material and texture by hand, if not, something is not well done on blender); the mesh should have a buffer with the tex-coords (to check this use: geom.getMesh().getBufferList();).

Once you make sure you know how to let it ready for jme3 in blender, you can try to set the stencil again.

cool, thanks, Ill give it a hoon and see how far I get