Jump to content

CubeCamera in Babylon


Raitch
 Share

Recommended Posts

I'm trying to recreate this panoramic code (https://github.com/spite/THREE.CubemapToEquirectangular/blob/master/src/CubemapToEquirectangular.js) from Three.js into Babylon.js.

Most stuff here it looks like I can replicate, like ShaderMaterial for instance. The thing I however can't wrap my head around fully is how to get the CubeCamera from Three.js to work in Babylon.js. 

According to the documentation (https://threejs.org/docs/#api/cameras/CubeCamera) it seems to create 6 cameras and put them in a cube map:

1182OS_04_17.png

I'm not fully sure how to best do the same thing in Babylon.js. The idea I guess is to have 6 cameras from the same point that each capture the same square, then place all of them on one texture. However I want to do this rendering each frame so I guess that's not really viable to do. Another idea I have is to use 2 canvases where one uses 6 mulitviews (https://doc.babylonjs.com/tutorials/how_to_use_multi-views) and the other canvas takes that image as a texture. 

Does anyone have a better idea, or know if my idea sounds unviable? Having 6 cameras run at the same time sounds potentially like a bad idea for me. If nothing else I can give it a try, but it's a lot of testing work I could avoid in case someone else have more insight than me on the subject. 

I really like Babylon.js and I hope I can solve this without Three.js :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...