Skip to content

Instantly share code, notes, and snippets.

@caseyyee
Created November 8, 2014 01:06
Show Gist options
  • Save caseyyee/e68104c2105c115067d1 to your computer and use it in GitHub Desktop.
Save caseyyee/e68104c2105c115067d1 to your computer and use it in GitHub Desktop.
Possible flicker fix
function setRenderMode(mode) {
var modes = VRClient.renderModes;
if (mode == modes.mono) {
console.log('Mono mode');
controls = new THREE.VRControls( camera );
effect = renderer;
cursor.setMode('mono');
cursor.hide();
} else if (mode == modes.stereo) {
console.log('Stereo mode');
// controls = new THREE.DeviceOrientationControls( camera );
controls = null;
effect = new THREE.StereoEffect( renderer );
//cursor.setMode('centered');
cursor.disable();
} else if (mode == modes.vr) {
console.log('VR mode');
controls = new THREE.VRControls( camera );
effect = new THREE.VREffect( renderer );
cursor.setMode('centered');
cursor.show();
}
effect.setSize( window.innerWidth, window.innerHeight );
}
// handle render mode changes from VR client and set appropriate renderer and control for mode.
VRClient.onRenderModeChange = setRenderMode;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment