SkyBox doesn't show

So I’ve just started playing around with JME a little bit, and while adding a skybox to the scene with the TerrainEditor by using 6 (1024x1024) images, it works fine in the SceneViewer, but when I launch my project it doesn’t show the SkyBox…when I use 1 texture (jpg) and select the option Sphere map it does show in game and SceneViewer, but when I deselect that option, it doesn’t show in game nor sceneviewer. If I use the BrightSky.dss as a single file it does view in the SceneViewer, but doesn’t in game. Any idea what I’m possibly doing wrong here?



Thanks in advance

Make sure you attached the skybox scene to the rootNode.

btw, I did a tutorial about creating skybox textures and creating a skybox with them :smiley: : http://hub.jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/jmonkeyengine-tutorial-how-to-create-skymaps-using-blender/



I’m able to load it in game just by loading the .j3o scene with the assetManager and attaching it to the rootNode.

Mhm alright,

I’ll look into the tutorial, but it’s weird though, I don’t feel like I’m doing anything wrong.



This is my current code:

Code:
package mygame;

import com.jme3.app.SimpleApplication;

public class Main extends SimpleApplication {

public static void main(String[] args) {
    Main app = new Main();
    app.start();
}

@Override
public void simpleInitApp() {
    flyCam.setMoveSpeed(30f);
    rootNode.attachChild(assetManager.loadModel("Scenes/Scene.j3o"));
}

}


The Scene.j3o contains:
-Terrain
-Sky
-DirectionalLight

Try to isolate the issues, create your skymap in a separated .j3o scene and load it in game.

Tried that, also didn’t work :S



After watching your video I tried adding the skybox by right-clicking ‘New Scene’ and then ‘Add Spatial’ → ‘Skybox’, which basically gave the same window, except JMP crashes when I click ‘finish’ after loading my 6 image files.

I had the same problem a few month ago.

The sky was culled out of the scene because of a small conflict in the SkyFactory and how culling was inherited during attachment to the rootNode.



I’m not sure if that bug has been fixed since…



You can check this thread :

http://hub.jmonkeyengine.org/groups/graphics/forum/topic/the-sky-disapears-depending-on-the-cameras-rotation/

@ozonegrif said:
I had the same problem a few month ago.
The sky was culled out of the scene because of a small conflict in the SkyFactory and how culling was inherited during attachment to the rootNode.

I'm not sure if that bug has been fixed since..

You can check this thread :
http://hub.jmonkeyengine.org/groups/graphics/forum/topic/the-sky-disapears-depending-on-the-cameras-rotation/

Ye I did notice that aswell when using 1 Sphere mapped texture. But that's not even my problem. I just want to be able to add a skybox to a j3o file and loading the skybox from there. But now my JMP is even crashing when I click 'Add Spatial' -> 'Skybox'...

Not really sure what to do :/

The jme3-test-data package has a .j3o skybox scene and skybox textures too, just create a new TestProject and look for a test class which load that skybox. Then you’ll find where that skybox is, so you can copy the skybox file and textures to your assets folder and load it in game. Or, if you won’t find that, tell me, that I share my skybox with you so you can make a test with that in game.

@glaucomardano said:
The jme3-test-data package has a .j3o skybox scene and skybox textures too, just create a new TestProject and look for a test class which load that skybox. Then you'll find where that skybox is, so you can copy the skybox file and textures to your assets folder and load it in game. Or, if you won't find that, tell me, that I share my skybox with you so you can make a test with that in game.

Yeah I already tried using the BrightSky.dds (which is included in the test-data), and just like every other texture, it shows up in the editor, but when I launch the game, it doesn't show up in there...Just like my own skybox

hmmmmm, ok, you isolated the issues, then it might be your jmp. Make that up to date.

@glaucomardano said:
hmmmmm, ok, you isolated the issues, then it might be your jmp. Make that up to date.

I tried that yesterday, and when I did it, I uninstalled it straight ahead and went back to the older version from 1 month ago, since I got so many complications with the new version, that I couldn't do anything...
For example when I ran my game, it looked like the flycam speed was alot lower, so I changed that up to 30, and when using that it was all lag and stutter..

I still feel like I'm overlooking something really stupid :P

Ok, did u say you saw a BrightSky.dds texture in jme3-test-data ok? Then look for a test class in a TestGame project which loads a skybox from the jme3-test-data package and set its texture to that texture, so we can see if that work.

Well, yea thanks for the help, I tried it programatically now, just saved me alot of time because I just can’t seem to get it working when I try to add it to a j3o file. I did it like this now:

Code:
Texture west, east, north, south, up, down;

west = assetManager.loadTexture("Textures/skybox_west.png");
east = assetManager.loadTexture("Textures/skybox_east.png");
north = assetManager.loadTexture("Textures/skybox_north.png");
south = assetManager.loadTexture("Textures/skybox_south.png");
up = assetManager.loadTexture("Textures/skybox_up.png");
down = assetManager.loadTexture("Textures/skybox_down.png");
rootNode.attachChild(SkyFactory.createSky(assetManager, west, east, north, south, up, down));

yea, you’re basically doing the same thing SceneExplorer does.

Yeah, I’d think that :stuck_out_tongue: Except it doesn’t work when I add in with SceneExplorer??? Weird but alright, it’s okay the way it is now :slight_smile: thanks for the help

@reveance said:
Except it doesn't work when I add in with SceneExplorer???


just for you :P

Haha alright, i’m just missing something simple, I’m still convinced :stuck_out_tongue: well, thank you for the effort anyways :slight_smile:

Maybe your hardware does not support cubemaps both DSS and 6 image methods are used as cube maps in the shader.

put this in your simpleInit method :



System.out.println(GL11.glGetString(GL11.GL_EXTENSIONS).indexOf(“GL_ARB_texture_cube_map”)>=0);



When you start the game, if “false” is ouput in the console then you hardware does not support cubemaps. If it outputs “true”, it’s another issue, but we’ll have this one ruled out.

@nehon said:
Maybe your hardware does not support cubemaps both DSS and 6 image methods are used as cube maps in the shader.
put this in your simpleInit method :
`
System.out.println(GL11.glGetString(GL11.GL_EXTENSIONS).indexOf("GL_ARB_texture_cube_map")>=0);
`
When you start the game, if "false" is ouput in the console then you hardware does not support cubemaps. If it outputs "true", it's another issue, but we'll have this one ruled out.

Well, if my hardware wouldn't support that, how would it be displayed in my SceneViewer, and more importantly how would it be displayed when I programatically add it?

Tried to insert that line, but I get an error because 'GL11' is not defined.
@reveance said:
Well, if my hardware wouldn't support that, how would it be displayed in my SceneViewer

good point, I did not get that the cube map was showing in the scene composer.


@reveance said:
Tried to insert that line, but I get an error because 'GL11' is not defined.

yeah you probably have to re-organize the imports