浏览代码

Added hint for context attributes

Peter Varga 6 年之前
父节点
当前提交
82ea1737fc
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      docs/manual/en/introduction/How-to-use-WebGL2.html

+ 6 - 1
docs/manual/en/introduction/How-to-use-WebGL2.html

@@ -48,9 +48,14 @@ if ( WEBGL.isWebGL2Available() === false ) {
 		automatically convert the built-in material's shader code to GLSL ES 3.00.
 	</p>
 
+	<p>
+		Since you are manually creating the WebGL 2 rendering context, you also have to pass in all necessary context attributes.
+		Note: It's not possible to modify these attributes after the context has been created, so passing them to the WebGLRenderer won't have any effect.
+	</p>
+
 	<code>
 var canvas = document.createElement( 'canvas' );
-var context = canvas.getContext( 'webgl2' );
+var context = canvas.getContext( 'webgl2', { antialias: false } );
 var renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context } );
 	</code>