javalang Posted July 27, 2017 Share Posted July 27, 2017 Hello, I'd like to get some suggestions for how to make a 3D-background from images. Let me explain a bit more: given two sets of images for a cubemap/skybox (one set for each eye), how to render each cubemap separately? In a normal VR-scene the camera renders twice (one render for each eye) for the same object. For stereo backgrounds IMHO the VR-camera also has to render twice but for different objects on the same place. How could I solve this? Hopefully the question is not too complicated and makes sense, thanks for input Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 27, 2017 Share Posted July 27, 2017 You can get left an right cameras from a VR main camera with camera.leftCamera and camera.rightCamera Then you can leverage camera.layerMask to mask meshes (having mesh 1 only visible to left camera and mesh 2 only visible to right camera) javalang 1 Quote Link to comment Share on other sites More sharing options...
javalang Posted July 27, 2017 Author Share Posted July 27, 2017 @Deltakosh thanks for the quick input, yeah layerMask is the right attempt. I'll get a try... Quote Link to comment Share on other sites More sharing options...
javalang Posted July 27, 2017 Author Share Posted July 27, 2017 Green an yellow dots are on different cubemaps, thats so cool, thank you again Mr @Deltakosh Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 28, 2017 Share Posted July 28, 2017 Wonderful! Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted October 4, 2017 Share Posted October 4, 2017 Hi, Thanks for solving this one, we had the same issue ! Still one issue, leftCamera and rightCamera does not seem to be ready once the webVRFreeCamera is instantiated See this one : http://playground.babylonjs.com/#QTTH9F it fails when trying to access leftCamera But this one : http://playground.babylonjs.com/#QTTH9F#2 is ok with the timeout Is there already an "onLoad" event when can register to ? camera.onReady does not seem to be the one. Thanks for your inputs ! Quote Link to comment Share on other sites More sharing options...
javalang Posted October 4, 2017 Author Share Posted October 4, 2017 Hmm, I always initialize the GamepadCamera and set the RigMode without initialization problems...playground Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 4, 2017 Share Posted October 4, 2017 3 hours ago, SvenFrankson said: Hi, Thanks for solving this one, we had the same issue ! Still one issue, leftCamera and rightCamera does not seem to be ready once the webVRFreeCamera is instantiated See this one : http://playground.babylonjs.com/#QTTH9F it fails when trying to access leftCamera But this one : http://playground.babylonjs.com/#QTTH9F#2 is ok with the timeout Is there already an "onLoad" event when can register to ? camera.onReady does not seem to be the one. Thanks for your inputs ! Seems fine when setting a rigMode, i don't really know the whole VR thing, so i'm not sure if it's a bug of some kind that it doesn't work with default. @Deltakosh ?http://playground.babylonjs.com/#QTTH9F#5 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 6, 2017 Share Posted October 6, 2017 You are correct. sub cameras are created when setting the rigMode which happens when WebVR is initialized (async) by the webvrcamera 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.