WebGLRenderer: WebGL fallback from WebGL2 does not honor context attributes

Consequently, the attributes must be repeated to take effect.

var canvas = document.createElement( 'canvas' );

var context = canvas.getContext( 'webgl2', { alpha: true } );

renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context, alpha: true } );
  • [ x ] Dev
  • [ x ] r115

2 thoughts on “WebGLRenderer: WebGL fallback from WebGL2 does not honor context attributes

  1. Agree that a change needs to be made (default webgl2 sounds great) but, until then, it is possible to use ES6 syntax to work around the issue:

    const canvas = document.createElement( 'canvas' );
    const params = {alpha: true, antialias: true, stencil: true};
    const context = canvas.getContext('webgl2', params);
    const renderer = new THREE.WebGLRenderer({canvas, context, ...params});