You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue
When adding an object (e.g. cube) to the camera while VREffect.js is active ghosting will occur on the object when the camera moves. This happens with master and dev versions (r.72) of Three.js and VREffect.js
To see the issue in action visit: http://misalabs.azurewebsites.net/ghosting/index.html using iPhone (iOS 8+ safari) or Android 4.4+ (Chrome). Press the "Cardboard" icon to activate VR mode. The live example is using webvr-manager but the issue can be recreated using the below code.
varrenderer=newTHREE.WebGLRenderer({antialias: true});renderer.setPixelRatio(window.devicePixelRatio);document.body.appendChild(renderer.domElement);varscene=newTHREE.Scene();varcamera=newTHREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,0.3,10000);//Add camera to scenescene.add(camera)// Apply VR headset positional data to camera.varcontrols=newTHREE.VRControls(camera);// Apply VR rendering to renderer.vareffect=newTHREE.VREffect(renderer);effect.setSize(window.innerWidth,window.innerHeight);// Create 3D object to attach to cameravargeometry=newTHREE.BoxGeometry(0.5,0.5,0.5);varmaterial=newTHREE.MeshNormalMaterial();varcube=newTHREE.Mesh(geometry,material);cube.position.z=-3;// Add cube to three.js cameracamera.add(cube);//Animation Loopfunctionanimate(timestamp){requestAnimationFrame(animate);controls.update();effect.render(scene,camera);}animate();
Expected outcome
The object added to the camera should appear fixed to the camera with no ghosting effect present while moving the camera.
Workaround:
If I add camera.updateMatrixWorld() before the effect.render(scene, camera) in the callback of the requestAnimationFrame() method the ghosting stops. For example:
To see the workaround in action visit: http://misalabs.azurewebsites.net/ghosting/no-ghosting.html
using iPhone (iOS 8 safari) or Android 4.4+ (Chrome). Press the "Cardboard" icon to activate VR mode. The live example is using webvr-manager but the workaround can be recreated using the above code.
The text was updated successfully, but these errors were encountered:
skezo
changed the title
VREffect.js: unwated ghosting occurs when objects are added to the camera
VREffect.js: unwanted ghosting occurs when objects are added to the camera
Aug 24, 2015
Issue
When adding an object (e.g. cube) to the camera while
VREffect.js
is active ghosting will occur on the object when the camera moves. This happens with master and dev versions (r.72) ofThree.js
andVREffect.js
To see the issue in action visit: http://misalabs.azurewebsites.net/ghosting/index.html using iPhone (iOS 8+ safari) or Android 4.4+ (Chrome). Press the "Cardboard" icon to activate VR mode. The live example is using webvr-manager but the issue can be recreated using the below code.
Expected outcome
The object added to the camera should appear fixed to the camera with no ghosting effect present while moving the camera.
Workaround:
If I add
camera.updateMatrixWorld()
before theeffect.render(scene, camera)
in the callback of therequestAnimationFrame()
method the ghosting stops. For example:To see the workaround in action visit: http://misalabs.azurewebsites.net/ghosting/no-ghosting.html
using iPhone (iOS 8 safari) or Android 4.4+ (Chrome). Press the "Cardboard" icon to activate VR mode. The live example is using webvr-manager but the workaround can be recreated using the above code.
The text was updated successfully, but these errors were encountered: