Octree rendering code refactored to RenderingState.