nikokoneko Posted February 6, 2017 Share Posted February 6, 2017 Hi, I noticed a problem with VRDeviceOrientationFreeCamera: when the window is resized, the content displayed by rig cameras get stretched. It looks exactly the same as when using one camera without calling engine.resize(). I am aware of this post, but I don't use distortion correction, hence there is no post process. I see that it has to do with metrics vResolution, but I don't know if I can update metrics after camera is created and force changes. I messed around with it, without success: http://www.babylonjs-playground.com/#W1NP4#0 Probably one workaround would be to call setCameraRigMode() for each window resize, but that seems terribly wasteful, as lots of new objects are being created (and destroyed). Any help much appreciated! Quote Link to comment Share on other sites More sharing options...
nikokoneko Posted February 6, 2017 Author Share Posted February 6, 2017 Ok I messed around a bit more, and came up with a nasty piece of code that does the trick: http://www.babylonjs-playground.com/#W1NP4#7 However, this literally has to trash the existing camera and create a new one for the settings to take effect. Still would like to know a more elegant solution Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 7, 2017 Share Posted February 7, 2017 I like the way you fixed it. Recreating camera is almost free as there is no postprocess attached. The other way is just to force the camera to update its projection matrix: http://www.babylonjs-playground.com/#W1NP4#8 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.