public void preloadScene(Spatial scene) {
        if (scene instanceof Node) {
            // recurse for all children
            Node n = (Node) scene;
            List<Spatial> children = n.getChildren();
            for (int i = 0; i < children.size(); i++) {
                preloadScene(children.get(i));
            }
        } else if (scene instanceof Geometry) {
            // addUserEvent to the render queue
            Geometry gm = (Geometry) scene;
            if (gm.getMaterial() == null) {
                throw new IllegalStateException("No material is set for Geometry: " + gm.getName());
            }

            gm.getMaterial().preload(this, gm);
            Mesh mesh = gm.getMesh();
            if (mesh != null
                    && mesh.getVertexCount() != 0
                    && mesh.getTriangleCount() != 0) {
                for (VertexBuffer vb : mesh.getBufferList().getArray()) {
                    if (vb.getData() != null && vb.getUsage() != VertexBuffer.Usage.CpuOnly) {
                        renderer.updateBufferData(vb);
                    }
                }
            }
        }
    }
Preloads a scene for rendering.

<p>After invocation of this method, the underlying
renderer would have uploaded any textures, shaders and meshes
used by the given scene to the video driver.
Using this method is useful when wishing to avoid the initial pause
when rendering a scene for the first time. Note that it is not
guaranteed that the underlying renderer will actually choose to upload
the data to the GPU so some pause is still to be expected.

@param scene The scene to preload
jme3-core/src/main/java/com/jme3/renderer/RenderManager.java