Case of the disappearing skybox

https://jme.dev.java.net/source/browse/jme/src/jmetest/TutorialGuide/HelloIntersection.java?rev=1.1&content-type=text/vnd.viewcvs-markup



The skybox totally disappears when I move the view away from the sphere in the middle. I only use like 10 lines of real code so it shouldn’t be to hard to figure out what i’m doing wrong

Your skybox is attached to root node and root node has a worldbound that is created by it’s children. The only child that has a bounding is the sphere… thus root node is culled if you are not looking at the sphere. You could set forceView on root node before adding any children to it or render the box seperately.



Also, in the update method you’ll want to add something like the following if you don’t want people to be able to catch up to the side of the box:



sb.setLocalTranslation(cam.getLocation());



You may want to increase the size of the skybox too, but just remember that the size has to be such that a corner of the skybox is within the renderer’s farplane… ie sqrt(3*side^2) < far plane distance. (Otherwise the corners of the skybox will be clipped or worse.)

Not sure how you implemented skybox, but if he did a setBoundingVolume/updateBoundingVolume on the skybox wouldn’t that cause the skybox to cull properly?

Skybox is a node I can’t set any bounds on it. Do it’s children have bounds?

After looking at the code, we could add a method (setBoundingVolume/updateBoundingVolume) to sky box that would in turn pass it to it’s children. The problem is… we are going to run into the same bug with rotation of entities and the boundings not being rotated. Each side of the sky box is a quad, who is then rotated to the appropriate side.

When we implemented Skybox, Graum and I chose Quads because it’s the least amount of geometry needed to support 6 different textures…



Using forceview will work… The node and it’s children already have it enabled, you just need to make sure it’s not under another node that can get culled. Forceview skips bounds/frustum checks and is much quicker in that respect.

True, however, all nodes should have boundings. Otherwise, behavior will be unpredictable from a user perspective. I don’t have a problem with the use of the quads, but it’s just another matter fixing the bug with the rotation of nodes and the bounding box not containing it.

Check out the current CVS version. My skybox is totally unvisable. As an example, I tried to render the skybox in simpleRender() instead of attaching it to the rootNode and it doesn’t work. (But I can see the skybox if it is attached to the root node). Why does skybox not work when it’s rendered by itself. sb.onDraw and sb.draw neither work



https://jme.dev.java.net/source/browse/jme/src/jmetest/TutorialGuide/HelloIntersection.java?rev=1.10&content-type=text/vnd.viewcvs-markup

If you break something off into its own tree (ie. not in the rootNode’s tree) you have to make sure you call updateGeometricState in your simpleUpdate method. That fixes your skybox issue.