Raitch Posted June 8, 2017 Share Posted June 8, 2017 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: 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 Quote Link to comment Share on other sites More sharing options...
max123 Posted June 8, 2017 Share Posted June 8, 2017 http://www.babylonjs-playground.com/#1P98HI#1 Quote Link to comment Share on other sites More sharing options...
Raitch Posted June 8, 2017 Author Share Posted June 8, 2017 29 minutes ago, max123 said: http://www.babylonjs-playground.com/#1P98HI#1 I think we're working from 2 different ends here. I want to generate Cube Maps, not use existing. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 8, 2017 Share Posted June 8, 2017 Why not using the probe for that? It is doing exactly what you mention: create a cubemap from a point of view Here is an example:http://www.babylonjs-playground.com/#KA93U#16 And doc: http://doc.babylonjs.com/tutorials/how_to_use_reflection_probes Raitch 1 Quote Link to comment Share on other sites More sharing options...
Raitch Posted June 8, 2017 Author Share Posted June 8, 2017 Nice! That looks exactly like what I'm after hope I can get it to work without too much lag GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.