Ok, I'm totally confused with this thing. Thought it was working, but its not.
Here's the relavent code…
_sphere = (TriMesh)BinaryImporter.getInstance().load(new ByteArrayInputStream(_sphereModel));
_sphere.setLocalTranslation(new Vector3f(0, 0, 0));
// We don't want the light to effect our skybox
setLightCombineMode(LightState.OFF);
setTextureCombineMode(TextureState.REPLACE);
ZBufferState zbuff = display.getRenderer().createZBufferState();
zbuff.setWritable(false);
zbuff.setEnabled(true);
zbuff.setFunction(ZBufferState.CF_LEQUAL);
setRenderState(zbuff);
// We don't want it making our skysphere disappear, so force view
setCullMode(Spatial.CULL_NEVER);
// Make sure texture is only what is set.
_sphere.setTextureCombineMode(TextureState.REPLACE);
// Make sure no lighting on the sphere
_sphere.setLightCombineMode(LightState.OFF);
// Make sure the sphere is viewable
_sphere.setCullMode(Spatial.CULL_NEVER);
// Set a bounding volume
_sphere.setModelBound(new BoundingSphere());
_sphere.updateModelBound();
_sphere.setRenderQueueMode(Renderer.QUEUE_SKIP);
_sphere.setVBOInfo(null);
// And attach the skysphere as a child
attachChild(_sphere);
And nothing displays unless I set the following on the skysphere object:
CullState cullState = DisplaySystem.getDisplaySystem().getRenderer().createCullState();
cullState.setCullMode(CullState.CS_NONE);
cullState.setEnabled(true);
setRenderState(cullState);
And I either get multiple bounding spheres, or a bounding sphere that doesn't move with the camera! (I can post pics if need be!)
If I switch to a quad, it works fine without setting the cull state to CS_NONE. The sphere is just a TriMesh itself loaded as from a .obj model of a geosphere.
What am I doing wrong?! Or am misunderstanding. :(