Hi there, I’m developing a game in JME3 and noticed that the triangle and vertex count were off when loading a scene through a viewport The scene should only have about 10K triangles at maximum, and yet as soon as I load the scene through a viewport, the object, triangle, and vertice counts start skyrocketing like there’s no tomorrow, and then my fps just plummets.
Here is the code that “causes” this:
fightCam = cam.clone(); fightCam.setViewPort(0.0f, 1.0f, 0.0f, 1.0f); screenView = renderManager.createMainView("Fight", fightCam); screenView.setClearFlags(true, true, true); battleScene = (Node)assetManager.loadModel("Scenes/Battle/battletest6.j3o"); screenView.attachScene(battleScene); fightCam.setLocation(new Vector3f(battleScene.getChild("FullPlane").getWorldTranslation().x, battleScene.getChild("FullPlane").getWorldTranslation().y + 1.5f, battleScene.getChild("FullPlane").getWorldTranslation().z + 11.25f)); Quaternion cameraRotation = new Quaternion(); cameraRotation.fromAngles(0, FastMath.PI, 0); fightCam.setRotation(cameraRotation); battleScene.updateLogicalState(tpf); battleScene.updateGeometricState();
cam is the main Camera, fightCam is the new Camera, and screenView is the ViewPort
I have no idea what causes this.