CubeMap/skybox

Well, I try to get a working skybox/cubemap,



looking at the examples in the test packeage it seems like I can only use a spheremap with then  sky material.



Now I try to find a way to render a background, wich can be used for reflections as well.

What I have is: 6 textures (top,bottom,left,right,front,back)



Now I either need a way to convert this to a spheremap (I honestly can't find any other than one tutorial with photoshop, wich I don't own) or I need a way to use those textures directly ( of course I can combine them into one if that's needed.



Any help wpuld be appreciated.

I just created six quads arranged as cube's planes and assigned textures on them. And you need to move it when your camera moves. And I probably put it to Sky bucket. Works fine for me.

Yes, but it has a few downsides, as far as I understood it, when I have it in spheremap form I can use it for reflections on glass ect, as well. (with the reflective material)

You can create a cubemap (TextureCubeMap) by loading 6 textures and using the images from them to form a cubemap. You can then set it on the sky material without setting the m_SphereMap boolean.

Do you eman I can create the cubemap with the help of TextureCubeMap, cause I can#t find a method to pass it more than one texture.



When I use a texture in cubemap everything is just black. (if mspheremap is false, else it is visible but of course not what i want)



           Sphere sky = new Sphere(32, 32, 10f);
        Geometry skyGeom = new Geometry("Sky", sky);
       skyGeom.setQueueBucket(Bucket.Sky);
       skyGeom.setShadowMode(ShadowMode.Off);
       skyGeom.updateModelBound();
       skyGeom.setCullHint(CullHint.Never);

     Texture fronttex = getAssetManager().loadTexture("cubemap.png");
     Image modifytocubemap = fronttex.getImage();
     modifytocubemap.addData(modifytocubemap.getData(0));
     modifytocubemap.addData(modifytocubemap.getData(0));
     modifytocubemap.addData(modifytocubemap.getData(0));
     modifytocubemap.addData(modifytocubemap.getData(0));
     modifytocubemap.addData(modifytocubemap.getData(0));
//whiel this makes few sense in terms of the picture, i should be able to see a total of 6 of them at least.
     
     TextureCubeMap cubemap = new TextureCubeMap(modifytocubemap);
     
     Material frontmat = new Material(getAssetManager(), "Common/MatDefs/Misc/Sky.j3md");
      frontmat.setTexture("m_Texture",cubemap);
      frontmat.setVector3("m_NormalScale", new Vector3f(-1, 1, -1));
      frontmat.setBoolean("m_SphereMap", false);
      skyGeom.setMaterial(frontmat);

     this.rootNode.attachChild(skyGeom);




BTW, once I found the correct way I think it would be a good idea if i write a cubemap-sky testclass for the test package, to save others some time

I think you have to make the cubemap with an image editor



maybe this can help you http://code.google.com/p/gimp-dds/ if you are familiar with the gimp

Well I tried it with a cubemap aranged texture as well, but then i get the warning that the texture has nto 6 data units.