Is this a CubeTexture - OrbitControls bug? [No]

I have a simple scene with a CubeTexture in the background.
When I position the camera at a specific position
one side of the cube texture disappears.

Here’s a simple example.

The problem goes away if you orbit the scene.
The problem goes away if I don’t instantiate OrbitControls.
The problem stays even if I instantiate OrbitControls
but I don’t use it in the animation loop.

Here’s the code:

var renderer = new THREE.WebGLRenderer ( );
renderer.setSize ( window.innerWidth , window.innerHeight ) ;
document.body.appendChild ( renderer.domElement ) ;

var scene = new THREE.Scene ( ) ;

var camera = new THREE.PerspectiveCamera ( 
	70 , window.innerWidth / window.innerHeight , 1 , 500 
);

camera.position.set ( 50 , 50 , 100 ) ;

var controls = new THREE.OrbitControls ( camera , renderer.domElement ) ;
	
new THREE.CubeTextureLoader().load(
		
	[
		'http://www.guzman.it/galaxy/corona_front.png' ,
		'http://www.guzman.it/galaxy/corona_back.png' ,	
		'http://www.guzman.it/galaxy/corona_top.png' ,
		'http://www.guzman.it/galaxy/corona_bot.png' ,	
		'http://www.guzman.it/galaxy/corona_right.png' ,	
		'http://www.guzman.it/galaxy/corona_left.png' ,
	],		
	
	// onLoad 
	function ( texture ) {
		scene.background = texture ;	
	}			
	
);

	
(function animate ( ) {
	renderer.render ( scene , camera ) ;
	controls.update ( ) ; 
	requestAnimationFrame ( animate ) ;
})();

r119.1 and last version of OrbitControls.

It seems that the problem appears when the position of the camera is of the form (x,x,2*x)

I’ve noticed this only happens in chrome.

I’m afraid I’m unable to reproduce. Can you please shows with screenshots the expected and actual result on your device?

see the missing bottom left corner …

it only happens when camera is on some positions and when OrbitControls is instantiated.

Actually also the top right corner is wrong … As soon as I move the camera it goes back to normal.

Can you please test with a different device? And maybe with a less dark skybox? :innocent:

Sorry about the darkness of the skybox …
You’re right !! … it only happens on my laptop with Chrome …
don’t know why.
Anyway, it’s no big deal, not a huge problem, I was only curious to know what causes this.

You could try to update the GPU driver if possible…

I found out my Chrome browser had a flag set to true that was only meant for Chrome Canary and that I don’t remember how I was able to set (in chrome://flags it was not visible, --enable-unsafe-webgpu).
I reset all the flags and the problem is now solved.
Thank you, you made me think about problems with my gpu and my browser.

1 Like