How can I render a spherical camera?

I am looking to add a spherical camera to my application. Ideally, it would just display to the screen like a normal camera would. I would like to record my application with OBS, and then turn that into a “360” video.

I have come across EnvironmentCamera which seems to describe what I am looking for, although I assume it’s not directly meant for what I’d like to use it for. I’m just not sure how to configure this so that it is rendered to the screen (it doesn’t help that I am fairly ignorant when it comes to the rendering process). Or perhaps I am looking in the wrong direction—or asking for something that’s not possible with what JME provides.

1 Like

I’ve written something like that. I’ll see if I can get permission to release it as OSS

1 Like

Released as is with a minimum of support!


I’m trying to run the example that you provided, but my output video is entirely black. The scene loads and the video file is saved, but just black.

I happened to notice in CustomVideoRecorderAppStateTest, you create this material in the first line of setupTestScene but never use it. Could this be the issue? Not sure what to apply this material to.

Material m = new Material(getAssetManager(), "MatDefs/CubeMapToEquiRect.j3md");

Hmm, that test produces a video with the 3 cubes for me, albeit at a slow rate. Perhaps you could try lowering the resolution of the output. It’s quite high (but you need a high res to get decent results, at least if VR is your goal).

I’ve tried adjusting both the video output and environment camera resolutions, nothing seems to help :confused:. However the default standard video recorder does work fine. I’ll try experimenting on a couple different computers and see what I get.

I’ve checked that everything is committed. If I come up with something, I’ll let you know.

Without touching any of the code yet, I receive a black video output. Both the Main and CustomVideoRecorderAppStateTest files. Do you know anything about that material that you instantiate but never apply? I appreciate your help with this!

Having just glanced through the code, my guess is that the material there is just left-over crud from some refactoring. That material is used and applied in the app state.

1 Like

Correct assessment, a leftover from refactoring. I’ve pushed a cleaned up version with lower resolution. I’ll look into this when I can, but don’t have much time right now. The version used for the test was 3.2, don’t know if there could be something changed in later versions. Seems unlikely.

1 Like

I’ve checked that the code still works on a “real” project. So at least there hasn’t been any ‘code rot’ in that project. But even if you can’t get it to work, perhaps it can inspire you to a solution on your own. It’s really just two classes, and the video recorder appstate is there just so that I could insert a custom camera.