-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scene.background and/or THREE.CubeCamera broken in WebXR #19428
Comments
I could imagine that this.update = function ( renderer, scene ) {
if ( this.parent === null ) this.updateMatrixWorld();
var currentXrEnabled = renderer.xr.enabled;
var currentRenderTarget = renderer.getRenderTarget();
renderer.xr.enabled = false;
var generateMipmaps = renderTarget.texture.generateMipmaps;
renderTarget.texture.generateMipmaps = false;
renderer.setRenderTarget( renderTarget, 0 );
renderer.render( scene, cameraPX );
renderer.setRenderTarget( renderTarget, 1 );
renderer.render( scene, cameraNX );
renderer.setRenderTarget( renderTarget, 2 );
renderer.render( scene, cameraPY );
renderer.setRenderTarget( renderTarget, 3 );
renderer.render( scene, cameraNY );
renderer.setRenderTarget( renderTarget, 4 );
renderer.render( scene, cameraPZ );
renderTarget.texture.generateMipmaps = generateMipmaps;
renderer.setRenderTarget( renderTarget, 5 );
renderer.render( scene, cameraNZ );
renderer.setRenderTarget( currentRenderTarget );
renderer.xr.enabled = currentXrEnabled;
}; This updated method requires to use the |
Lovely - thanks a bunch! Solves it right out of the box (minus adding Before closing - while I'm content hoarding this nice fix to myself, would this merit a quick PR? Happy to do it if so. |
Yeah, feel free to make a PR with the fix 👍 |
And yes, it's necessary to do this when using the current |
Description of the problem
Hello,
What it says on the tin. Got a nice day/night cycle based on the ocean shader example. Relevant code is:
and in my render loop:
looks great on screen (right click+WASDQE to travel around), very broken in WebXR (tested on the Quest and in SteamVR via Virtual Desktop). Coordinate frame is all wonky, scale is all over the place, hard to even tell what's happening - guessing
scene.background
needs special treatment in the separate XR render loop?Full code here. Feedback / thoughts appreciated! Happy to take a stab at fixing it myself but not sure where to start...
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
Presumably any VR device; I'm testing on the quest via oculus browser and via Virtual Desktop / SteamVR.
The text was updated successfully, but these errors were encountered: