Cubemap texture displaying as text

my code to load a DDS cubemap is:
[java]
Texture tex = getTex(blockId);
tex = Main.app.getAssetManager().loadTexture(“Textures/BlockColorMaps/GrassMap.dds”);
Image img = tex.getImage();
tex = new TextureCubeMap();
tex.setImage(img);
[/java]
but it does not display the actual image, it displays “random” characters (I’m guessing its the binary makeup of the image) on the faces. I can’t figure out if it’s a problem with my cube map (I used the nvida exporter plugin for photoshop) or if jmonkey is having trouble. Please help! :slight_smile: thanks in advance

Don’t do it like that.
You have to load the image directly as a cubemap.
To do this you have to use a TextureKey

TextureKey key = new TextureKey((“Textures/BlockColorMaps/GrassMap.dds”, true); // the boolean param is to flip the texture on the Y axis , maybe you won’t need it experiment
key.setGenerateMips(true); // this is also optional
key.setAsCube(true); // this is the important part
Texture tex = assetManager.loadTexture(key);

2 Likes

thanks so much! :smiley: been playing around with jmonkey for a few days and this had me stumped, now I’m stuck on making the flyCam move forward based off the global axis instead of going forward with the camera (such as being able to move forward while looking down instead of going down) but now that I can use my cube map I’ll come back to that problem later