SkyFactory problem

Edit* : after importing the jme3-test-data library and using “Textures/Sky/Bright/BrightSky.dds”, I have a working skybox. The problem seems to be either 1) the image file format or 2) the folder / location of my jpg. Will continue farting around with it…



Im very new to jMonkey, and have been humming along mostly nicely, but this simple one has me stumped.

public void simpleInitApp() {

//did stuff here…

rootNode.attachChild(SkyFactory.createSky(assetManager,

assetManager.loadTexture(“Textures/skybox.jpg”),

false));

//I have tried this

//rootNode.attachChild(SkyFactory.createSky(assetManager,

// “Textures/skybox.jpg”,

// false));

//as well

//more stuff here

}

It builds and runs fine, but no sky box is visible in the game.

The texture is named correctly, in the right place (Im sure because I have a textured box that works fine with a jpg in the same folder).

I have a 512x512 jpg as the box (I noticed non power of 2 images dont work with regular textures so I set it to 512x512)

I have tried other images / formats / sizes too, same result.

I have gone over the documentation “How to add a sky to your scene” here : https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:sky?s[]=skyfactory

I have looked for info on the SkyFactory class here : http://www.jmonkeyengine.com/doc/allclasses-noframe.html and could not find anything :frowning:

I have searched the forums and only found 4 mentions of SkyFactory, none of which offered a solution I could use.

I have sacraficed an offering to Mota. Nothing.

Try to remove the RootNode’s culling, I had a similar problem in this thread :



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



Of course it’s not a permanent solution. You will have to find out how to manage your objects if this works out.

Heya ozonegrif,



Regarding : “…Try to remove the RootNode’s culling…”



and



Geometry sky = new Geometry(“Sky”, sphereMesh);

sky.setQueueBucket(Bucket.Sky);

sky.setCullHint(Spatial.CullHint.Never);



I thought those 2 functions were called automatically when you call SkyFactory.createSky(…)



https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:sky?s[]=skyfactory



“Internally, the SkyFactory calls the following methods:

sky.setQueueBucket(Bucket.Sky); makes certain the sky is rendered in the right order, behind everything else.

sky.setCullHint(Spatial.CullHint.Never); makes certain that the sky is never culled.”

Setting SkyFactory to use a spherical map works… this is the darndest bug…



rootNode.attachChild(SkyFactory.createSky(assetManager,

p,

true));

SkyFactory sets the sky’s Culling, not the RootNode’s Culling.

In the thread I point you, I tried to remove the RootNode’s Culling, and it solved the problem for me.



They also suggested to scale the sky spatial to make it bigger and prevent the Culling. Everything is explained in this other thread.