chicagobob123 Posted July 18, 2016 Share Posted July 18, 2016 Using the WebVRFreeCamera with the Samsung Gear VR the scene looks flat 2D not 3D. Any ideas on how to add depth. Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 18, 2016 Share Posted July 18, 2016 Hi! that's an interesting question Would it be possible to capture your screen and paste it here? I want to see the difference between the two screens. Technically, you could change the distance between the two eyes. But I just found out it was technically impossible to do! So a PR was submitted and I will soon show you how to do it. Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted July 18, 2016 Author Share Posted July 18, 2016 Tried to get as close to the same location with the same info. I also thought you would just tweak the eye to eye distance. sorry content kind of boring at the moment,. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 18, 2016 Share Posted July 18, 2016 Hi kids! Um, @JCPalmer taught myself and @ozRocker a way to do nose-bridge widening... using the viewport positions of the rig cameras. http://playground.babylonjs.com/#1JSXHW#18 See lines 32/33? Magic, eh? They must be done AFTER the setCameraRigMode in line 29. I left the nose-bridge area brown, for now. camera._rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.45, 1.0); start at 0% X and 0% Y -> \__\ \ \ \____\ <- extending 45% X and 100% Y camera._rigCameras[1].viewport = new BABYLON.Viewport(0.55, 0, 0.45, 1.0); start at 55% X and 0% Y -> \__\ \ \ \____\ <- extending 45% X and 100% Y Viewport sizing/placing is a little weird, so I thought I would try to diagram it for the youngsters. 0,0 is at lower-left corner of screen, just like textures. (Dad72 taught me that. During a multi-viewport test, I got stuck in webmaster mode, thinking 0,0 was in upper-left corner of screen. Dummy me.) Back to the PG demo, line 24... adjusts the distance between "views" in each eye-port. (cross-eyed or wall-eyed). What are the interpupillaryDistance and interaxialDistance parameters in line 29 used for, you ask? I have no idea. And why doesn't the mouse work here, you ask? I have no idea. Aren't I helpful? heh JC also coded a non-encircled stereoscopic rig-mode. I like it. http://playground.babylonjs.com/#CV4CX#1 Mouse works, yay! Quote Link to comment Share on other sites More sharing options...
dbawel Posted July 19, 2016 Share Posted July 19, 2016 @chicagobob123- The interaxialDistance is how we set the distance between the two cameras used to render the stereoscopic "effect" which simulates 3D on a 2D plane. However, the interpupillaryDistance is the seting used to simulate the actual distance between the center of the person (user's) pupils. I don't understand why the interpupillaryDistance is often set to some arbitrary value such as the value of 0.01 in @Wingnut PG scene, since there are real physical limits to the human anatomy which on average is between 60mm and 65mm (closer to 60mm for females and closer to 65mm for males.) And these values work together to determine the quality of your 3D scene since you must consider the distance from your camera to the action (objects) in order to set a comfortable viewing experience. For my own tests, I always allow the user to adjust the interpupillaryDistance with a simple GUI control, as this makes a HUGE difference for each individual user. As for the interaxialDistance, this should remain as a constant for any scene. But you need to experiment for this value based upon the distance from camera to action. Below is some info I posted previously to help understand the math required to calculate these in the real world, but also translates to the digital VR world. Stereoscopic Parallax Budget (sometimes called Depth Budget) vs Depth Bracket The Depth Bracket of your scene refers to the actual distance between your closest object in the frame and the furthest object. The Parallax Budget refers to your calculated maximum positive parallax and desired maximum negative parallax represented in percentage of screen width. For example if I determine through a simple calculation that my positive parallax should never exceed 0.7% of screen width and I have determined that my negative parallax should not exceed 2% of screen width, then my total Parallax Budget is 2.7%. The Depth Bracket must be able to be squeezed into the Parallax Budget. There are many algebraic formulas to determine the proper interaxial distance to achieve this. Native Parallax for final display size The native parallax for a given screen size simply refers to what percentage of screen width will equal the human interocular. If you are using 2.5 inches as the baseline interocular and you know your presentation screen will be 30 feet wide (360 inches) then just divide 2.5 by 360. 2.5 ÷ 360 = 0.007 or 0.7% Therefore the Native Parallax of a 30 foot screen is 0.7%, so we should make sure to keep our maximum positive parallax under 0.7% of screen width if we plan to show our footage on a 30 foot wide screen. If we shoot for a 65” 3DTV, then we can get away with over 3% positive parallax. The 1/30th Rule The 1/30 rule refers to a commonly accepted rule that has been used for decades by hobbyist stereographers around the world. It basically states that the interaxial separation should only be 1/30th of the distance from your camera to the closest subject. In the case of ortho-stereoscopic shooting that would mean your cameras should only be 2.5” apart and your closest subject should never be any closer than 75 inches (about 6 feet) away. Interaxial x 30 = minimum object distance or Minimum object distance ÷ 30 = Interaxial I hope this helps. DB Wingnut 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 19, 2016 Share Posted July 19, 2016 Hi, thanks everyone for all of the info About the scene - the reason it looks "flat" is probably because you don't have a lot of objects in the scene, and the objects you do look at are very far away. You have a skybox (which is a flat simulation of a real sky), and a ground (again, flat). Try adding more objects and see if it looks better. You can see there is a difference between the two eyes. If you DO want to change the distance between the eyes (thank you @dbawel for this great information!) pass a new VRCameraMetrics object when creating the camera (using the latest code, as this functionality was added just yesterday): var vrCameraMetrices = VRCameraMetrics.GetDefault(); //do the changes you want to here: vrCameraMetrics.interpupillaryDistance = 0.06; var cam = new WebVRFreeCamera("myCameraRocks!", BABYLON.Vector3.Zero(), scene, true, vrCameraMetrics) Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 19, 2016 Share Posted July 19, 2016 Cool info, guys! Wingnut put those arbitrary (0.01) values in there. No intelligence behind it. I just gave them some value. Testing/learning playgrounds should have every knob and dial possible, even if guys like me don't know what those knobs and dials do, or what their values should be set-to. I assume that this new functionality is optional. Also, interpupillaryDistance and interaxialDistance are not members of VRCameraMetrics.GetDefault(), by default. See console output in that #18 playground. Should they be default members? I'm not qualified to be in this discussion, but I sure am enjoying all this great learning from this in-forum documentation. Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted July 19, 2016 Author Share Posted July 19, 2016 Some one copy and paste that into the documentation fit the camera that was fantastic info. Thanks to everyone! Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted July 19, 2016 Author Share Posted July 19, 2016 vrCameraMetrics.interpupillaryDistance = 0.06; Is this to be considered in mm or is just a number you tweak? Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 19, 2016 Share Posted July 19, 2016 Oh, this was just to show you how to change the values. The default value is aprox. 0.06 , and this is why I chose this value. I have to say - I am not sure who set the default values and at what units they are. I will research a bit further and keep you updated, but maybe @Deltakosh can also help with that. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 19, 2016 Share Posted July 19, 2016 It is meters: https://developer.oculus.com/documentation/intro-vr/latest/concepts/bp_app_imaging/ 0.06meter (average IPD (based on data from a survey of approximately 4,000 U.S. Army soldiers) is about 63.5 mm) Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 19, 2016 Share Posted July 19, 2016 Are they gamer-soldiers? Quote Link to comment Share on other sites More sharing options...
dbawel Posted July 19, 2016 Share Posted July 19, 2016 @RaananW - It's a good day when I actually get a laugh from reading a post on the forum. Yes, these values are in mm, and as I posted above, females have a base interpupillaryDistance on average of 60mm, whereas males average 65mm. But as also mentioned,if you don't allow the user to adjust this value specifically, then the experience will get uncomfortable very fast. I was fortunate enough to work with Vince Pace who developed and built most of the 3D cameras used on films today - and we rarely changed the interaxialDistance, since this doesn't affect quality or comfort very much - unless your action (objects) are unusually distant from your cameras. However, the interpupillaryDistance is what gives the viewer a headache faster than anything, and should always provide the viewer with controls to change this as a single mm can make the difference between illness in viewing and/or comfort in viewing. And this also falls into what we used to call the 30 formula for setting the values based upon the distance from camera to action - which is crucial to understand and to set correctly - which is generally a ballpark anyway, however both interpupillaryDistance and interaxialDistance work together to create good 3D depth. And in the case of a skybox, if you want the best result then create 2 skyboxes - one with a gradient blue, and the other with an alpha channel for each image containing clouds and/or other elements so that depth is created - which makes a huge difference depending on how you set your 2nd skybox with the alpha images inside the gradient skybox. Experiment with this, and you'll get far beyond the flat skybox we currently see in most VR tests these days. Remember 3D depends on 3 dimensional objects which a single skybox will not provide - so simply seperate out the skybox elements and scale the skybox with the images such as clouds, terrain, etc with the alpha channel inside of the larger skybox outside of the one with all 3D elements. This is a simple solution, however, creating more image files inside of the larger skybox can get interesting, and take very little time to set up. So to go beyond what everyone else is currently doing, just thinking outside of the "skybox" a bit - and yes, pun intended. But most important, follow the math for setting your camera's matrix as close as possible to render reasonable 3D based upon the distance from camera to action - and I promise the simple elements of the math I provided has worked for most every 3D film you've seen in theatres - and will provide good results using the babylon.js VRCamera. Otherwise, this is why most current VR in WebGL sucks - so use the proven math. And if you want better 3D, just begin here, and ask for more when you have the best results using what is provided above - as I'm happy to share everything I learned from Chuck Comisky - a good friend of mine. Do a web search for his name, and you'll know who he is. The least I can do is share what little I learned from working with Chuck, and actually that's about as much as anyone knows, yet more than most anyone working in VR today. Cheers, DB Quote Link to comment Share on other sites More sharing options...
Terminator Posted July 20, 2016 Share Posted July 20, 2016 21 hours ago, RaananW said: Hi, thanks everyone for all of the info About the scene - the reason it looks "flat" is probably because you don't have a lot of objects in the scene, and the objects you do look at are very far away. You have a skybox (which is a flat simulation of a real sky), and a ground (again, flat). Try adding more objects and see if it looks better. You can see there is a difference between the two eyes. If you DO want to change the distance between the eyes (thank you @dbawel for this great information!) pass a new VRCameraMetrics object when creating the camera (using the latest code, as this functionality was added just yesterday): var vrCameraMetrices = VRCameraMetrics.GetDefault(); //do the changes you want to here: vrCameraMetrics.interpupillaryDistance = 0.06; var cam = new WebVRFreeCamera("myCameraRocks!", BABYLON.Vector3.Zero(), scene, true, vrCameraMetrics) There is a typo, it should be vrCameraMetrics instead of vrCameraMetrices I also tried the code but it is not working, I am getting this error: Uncaught ReferenceError: VRCameraMetrics is not defined I wasn't sure from where to get the latest release so I downloaded it from here: https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview release/babylon.js is this the right link? dbawel 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 24, 2016 Share Posted July 24, 2016 Well, yes, the class exists (https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/VR/babylon.vrCameraMetrics.ts), but you are missing the BABYLON namespace (my bad, I think typescript and write javascript). Keep us updated! 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.