Skip to content

Commit 3dcd0ae

Browse files
Dat Chulynndang
Dat Chu
authored and
lynndang
committed
use WebGL2 by default
1 parent 6dacd58 commit 3dcd0ae

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/core/scene/a-scene.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,9 @@ class AScene extends AEntity {
603603

604604
this.maxCanvasSize = {height: 1920, width: 1920};
605605

606-
// By default, we are having 8Frame 1.1.0 run WebGL1 instead of vanilla Aframe-1.1.0's
607-
// default behavior of using WebGL2.
608-
let useWebGL2 = false;
606+
// Use WebGL2 as long as it is available or the user specifies webgl2: false. Aframe-1.3.0
607+
// and later are also WebGL2 by default.
608+
let useWebGL2 = true;
609609
if (this.hasAttribute('renderer')) {
610610
rendererAttrString = this.getAttribute('renderer');
611611
rendererAttr = utils.styleParser.parse(rendererAttrString);
@@ -635,10 +635,8 @@ class AScene extends AEntity {
635635
}
636636

637637
if (rendererAttr.webgl2) {
638-
// We only want to use WebGL2 if they explicitly specify 'renderer: "webgl2: true"' and
639-
// their device is capable of webgl2 rendering.
640-
const isWebGL2Available = !!document.createElement('canvas').getContext('webgl2');
641-
useWebGL2 = rendererAttr.webgl2 === 'true' && isWebGL2Available;
638+
// If the user specifies 'renderer: "webgl2: false"' then we will use webgl 1.
639+
useWebGL2 = rendererAttr.webgl2 !== 'false';
642640
}
643641

644642
this.maxCanvasSize = {

0 commit comments

Comments
 (0)