three.js: First-time rendering fails on the Chrome browser

Description of the problem

The first time calling of ‘renderer.render’ will draw nothing in the Chrome browser (v61 or after).

The test code:

var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );

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

var geometry = new THREE.BoxGeometry( 1, 1, 1 );
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
var cube = new THREE.Mesh( geometry, material );
scene.add( cube );

camera.position.z = 5;

var draw = function () {
    cube.rotation.x += 0.1;
    cube.rotation.y += 0.1;
    renderer.render(scene, camera);
};

draw();
Three.js version
  • Dev
  • r87
Browser
  • [] All of them
  • Chrome
  • Firefox
  • Safari
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS (10.13 High Sierra)
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (3 by maintainers)

Most upvoted comments

It sounds like this reduced test case https://github.com/KhronosGroup/WebGL/pull/2543 is sufficient, and we no longer need the reduced test case as @kenrussell had requested.

@Mann90 Can you please paste about:gpu in your address bar and copy the entire page to a new pastebin.

/cc @kenrussell