From e6b297c6bd77feea299c76e39de1ab5c5e01430d Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Wed, 10 Jun 2020 17:39:30 -0700 Subject: [PATCH] Examples: Removed context creation from WebGL2 examples. --- examples/webgl2_buffergeometry_attributes_integer.html | 4 +--- examples/webgl2_materials_texture2darray.html | 5 +---- examples/webgl2_materials_texture3d.html | 4 +--- examples/webgl2_multisampled_renderbuffers.html | 5 +---- examples/webgl2_sandbox.html | 5 +---- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/examples/webgl2_buffergeometry_attributes_integer.html b/examples/webgl2_buffergeometry_attributes_integer.html index 100dc9b879cc1b..c2058619c2c8cc 100644 --- a/examples/webgl2_buffergeometry_attributes_integer.html +++ b/examples/webgl2_buffergeometry_attributes_integer.html @@ -144,9 +144,7 @@ // renderer - var canvas = document.createElement( 'canvas' ); - var context = canvas.getContext( 'webgl2', { alpha: false } ); - renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context } ); + renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); diff --git a/examples/webgl2_materials_texture2darray.html b/examples/webgl2_materials_texture2darray.html index 4f84c63ef81e46..8087452ccbec18 100644 --- a/examples/webgl2_materials_texture2darray.html +++ b/examples/webgl2_materials_texture2darray.html @@ -122,10 +122,7 @@ // 2D Texture array is available on WebGL 2.0 - var canvas = document.createElement( 'canvas' ); - var context = canvas.getContext( 'webgl2', { alpha: false, antialias: false } ); - - renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context } ); + renderer = new THREE.WebGLRenderer(); renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); container.appendChild( renderer.domElement ); diff --git a/examples/webgl2_materials_texture3d.html b/examples/webgl2_materials_texture3d.html index e43c076751a915..539b70a9b17d5c 100644 --- a/examples/webgl2_materials_texture3d.html +++ b/examples/webgl2_materials_texture3d.html @@ -43,9 +43,7 @@ scene = new THREE.Scene(); // Create renderer - var canvas = document.createElement( 'canvas' ); - var context = canvas.getContext( 'webgl2', { alpha: false, antialias: false } ); - renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context } ); + renderer = new THREE.WebGLRenderer(); renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); diff --git a/examples/webgl2_multisampled_renderbuffers.html b/examples/webgl2_multisampled_renderbuffers.html index 78bf74605b9003..c95189ac921934 100644 --- a/examples/webgl2_multisampled_renderbuffers.html +++ b/examples/webgl2_multisampled_renderbuffers.html @@ -106,10 +106,7 @@ // - var canvas = document.createElement( 'canvas' ); - var context = canvas.getContext( 'webgl2', { alpha: false, antialias: false } ); - - renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context } ); + renderer = new THREE.WebGLRenderer(); renderer.autoClear = false; renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( container.offsetWidth, container.offsetHeight ); diff --git a/examples/webgl2_sandbox.html b/examples/webgl2_sandbox.html index 275276039e5d94..25e906659be357 100644 --- a/examples/webgl2_sandbox.html +++ b/examples/webgl2_sandbox.html @@ -62,10 +62,7 @@ } - var canvas = document.createElement( 'canvas' ); - var context = canvas.getContext( 'webgl2', { alpha: false, antialias: true } ); - - renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context } ); + renderer = new THREE.WebGLRenderer(); renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement );