Seems obvious, but it’s hard to explain. Here’s the code:
farCam = app.getCamera(); nearCam = farCam.clone(); float aspect = (float) farCam.getWidth() / (float) farCam.getHeight(); farViewPort = app.getViewPort(); farCam = app.getCamera(); nearCam = this.farCam.clone(); farCam.setFrustumPerspective(70.0F, aspect, 19.99F, 50000.0F); nearCam.setFrustumPerspective(70.0F, aspect, 0.01F, 20F); nearCam.setViewPort(0.0f, 1.0f, 0.0f, 1.0f); nearViewPort = this.app.getRenderManager().createMainView("NearView", nearCam); nearViewPort.setBackgroundColor(ColorRGBA.BlackNoAlpha); // farViewPort.setBackgroundColor(ColorRGBA.BlackNoAlpha); nearViewPort.attachScene(app.getRootNode());
I know the near and far frustums are a little weird, but I’ve tried lots of numbers. Originally I tried doing this myself, and I had the same problems. So I copied the code from the JmePlanet system (this chunk of code is an exact copy, except the frustums are changed a tad.) Same problem there. Here’s what’s happening:
The noticeable line is the start of the far viewport. It seems like it’s rendering the far over the near. I’ve tried flipping the frustums of the far and near cam, changing background colors, changing frustums, etc. and I can’t seem to fix it. Is there something blatantly obvious I’m missing?