Hello,
SkyFactory.createSky(assetManager, filepath, true); works but SkyFactory.createSky(assetManager, filepath, false); don’t work, why?
[java]
public class Main extends SimpleApplication {
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
Box b = new Box(Vector3f.ZERO, 1, 1, 1);
Geometry geom = new Geometry(“Box”, b);
Material mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
mat.setColor(“Color”, ColorRGBA.Blue);
geom.setMaterial(mat);
Spatial sky = SkyFactory.createSky(assetManager, “Textures/skybox.jpg”, false); // this don’t work?
//Spatial sky = SkyFactory.createSky(assetManager, “Textures/skybox.jpg”, true); // this works
rootNode.attachChild(sky);
rootNode.attachChild(geom);
}
}[/java]
I seen “https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:sky”.
You can test this if you wan’t, this code runs, I got the example texture from
“http://1.bp.blogspot.com/_uVsWqMqIGQU/SN0IZEE117I/AAAAAAAAAPs/4lfHx1Erdqg/s1600/skybox”.
Hey!
This wasn’t immediately obvious from the tutorial, but you have to convert those unwrapped cubemaps into a cubemap DDS file. You’ll want to download the nVidia DDS Photoshop plugin (and get Photoshop, for that matter) and then convert those cubemaps into the horizontal strip the plugin uses.
This was very useful when I was trying to get my space skybox to work:
http://www.cgtextures.com/content.php?action=tutorial&name=cubemaps
nVidia Plugin:
http://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop
There is also a free Ati tool that does the same, and does not need photoshop. (Cant remember name however)
CubeMapGen perhaps?
http://developer.amd.com/archive/gpu/cubemapgen/pages/default.aspx
at the end of the page you got the DL links…
cheers…
<cite>@luke1985 said:</cite> This could have been mentioned in the documentation as thousands other things which are not, making developers guessing thousand things before geting into the point of getting something actually to work. If there were some better documented engine i would sincerely make a switch.
Yeah, this is the best documented engine I’ve ever used… even out of some commercial engines. I was up to speed and productive in about an hour when I first started.
I missed the OP by a few months but I wrote a little about baking skymaps in blender. The blender part is not relevant here but the code example might be since you can always cut up your image and load images for the 6 sides of the sky cube separately.
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:external:blender#skybox_baking
Emil Persson of Avalanche Studios has published around 100 cube map images using Creative Commons here: Humus - Textures
Thank You for pointing out all this. It saves me from the need of creating .dds files.