소스 검색

Docs: Remove outdated WebGL 2 guide.

Mugen87 5 년 전
부모
커밋
0ce42ec511
3개의 변경된 파일0개의 추가작업 그리고 254개의 파일을 삭제
  1. 0 2
      docs/list.js
  2. 0 127
      docs/manual/en/introduction/How-to-use-WebGL2.html
  3. 0 125
      docs/manual/zh/introduction/How-to-use-WebGL2.html

+ 0 - 2
docs/list.js

@@ -11,7 +11,6 @@ var list = {
 				"WebGL compatibility check": "manual/en/introduction/WebGL-compatibility-check",
 				"How to run things locally": "manual/en/introduction/How-to-run-things-locally",
 				"Typescript setup": "manual/en/introduction/Typescript-setup",
-				"How to use WebGL 2": "manual/en/introduction/How-to-use-WebGL2",
 				"Drawing lines": "manual/en/introduction/Drawing-lines",
 				"Creating text": "manual/en/introduction/Creating-text",
 				"Loading 3D models": "manual/en/introduction/Loading-3D-models",
@@ -470,7 +469,6 @@ var list = {
 				"WebGL兼容性检查": "manual/zh/introduction/WebGL-compatibility-check",
 				"如何在本地运行Three.js": "manual/zh/introduction/How-to-run-things-locally",
 				"Typescript设置": "manual/zh/introduction/Typescript-setup",
-				"如何使用WebGL 2": "manual/zh/introduction/How-to-use-WebGL2",
 				"画线": "manual/zh/introduction/Drawing-lines",
 				"创建文字": "manual/zh/introduction/Creating-text",
 				"载入3D模型": "manual/zh/introduction/Loading-3D-models",

+ 0 - 127
docs/manual/en/introduction/How-to-use-WebGL2.html

@@ -1,127 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-	<meta charset="utf-8">
-	<base href="../../../" />
-	<script src="list.js"></script>
-	<script src="page.js"></script>
-	<link type="text/css" rel="stylesheet" href="page.css" />
-</head>
-
-<body>
-	<h1>[name]</h1>
-
-	<p>
-		Starting with three.js R95, the engine supports rendering with a WebGL 2 context. By default three.js always uses a
-		WebGL 1 context when creating an instance of *WebGLRenderer*. If you want use a WebGL 2 context, please have a look
-		at the following workflow.
-	</p>
-
-	<h2>Workflow</h2>
-
-	<p>
-		Since WebGL 2 is not supported by all devices that support WebGL 1, it's important to check the respective availability.
-		To do so, please include [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js WebGL.js] into your project.
-	</p>
-
-	<code>
-import { WEBGL } from 'three/examples/jsm/WebGL.js';
-	</code>
-
-	<p>
-		Next, use a code similar to the following in order to perform the availability check.
-	</p>
-
-	<code>
-
-if ( WEBGL.isWebGL2Available() === false ) {
-
-	document.body.appendChild( WEBGL.getWebGL2ErrorMessage() );
-
-}
-	</code>
-
-	<p>
-		Now it's time to create the renderer by applying the HTML5 canvas element and the respective WebGL 2 context
-		to the constructor of *WebGLRenderer*. As a result, three.js will internally use the given context for rendering and
-		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', { alpha: false } );
-var renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context } );
-	</code>
-
-	<p>
-		Sometimes it is necessary to write custom shader code. Use the following code template as a basis for your own
-		implementation. First, the GLSL ES 3.00 code.
-	</p>
-
-	<code>
-&lt;script id="vs" type="x-shader/x-vertex"&gt;
-#version 300 es
-
-void main() {
-
-	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
-
-}
-&lt;/script&gt;
-&lt;script id="fs" type="x-shader/x-fragment"&gt;
-#version 300 es
-
-precision highp float;
-precision highp int;
-out vec4 out_FragColor;
-
-void main() {
-
-	out_FragColor = vec4( 1.0 );
-
-}
-&lt;/script&gt;
-	</code>
-	<p>
-		Second, the corresponding material creation in JavaScript.
-	</p>
-	<code>
-var material = new THREE.ShaderMaterial( {
-	vertexShader: document.getElementById( 'vs' ).textContent.trim(),
-	fragmentShader: document.getElementById( 'fs' ).textContent.trim()
-} );
-	</code>
-
-	<h2>Next Steps</h2>
-
-	<p>
-		Have a look at one of the official examples in order to see WebGL 2 features in action.<br /><br />
-
-		[example:webgl2_materials_texture3d WebGL2 / materials / texture3d]<br />
-		[example:webgl2_materials_texture2darray WebGL2 / materials / texture2darray]<br />
-		[example:webgl2_multisampled_renderbuffers WebGL2 / multisampled renderbuffers]
-	</p>
-
-	<h2>Supported features</h2>
-
-	<p>
-		Right now, the engine does only support a subset of all existing WebGL 2 features. The following list provides an
-		overview about what's already available in the latest version of three.js.
-		<ul>
-			<li>3D Textures</li>
-			<li>2D Texture Arrays</li>
-			<li>Multisampled Renderbuffers</li>
-			<li>Non-power of two (POT) textures work just the same as POT textures now. No resizing is required for best quality.</li>
-		</ul>
-
-	</p>
-
-</body>
-
-</html>

+ 0 - 125
docs/manual/zh/introduction/How-to-use-WebGL2.html

@@ -1,125 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh">
-
-<head>
-	<meta charset="utf-8">
-	<base href="../../../" />
-	<script src="list.js"></script>
-	<script src="page.js"></script>
-	<link type="text/css" rel="stylesheet" href="page.css" />
-</head>
-
-<body>
-	<h1>如何使用WebGL 2([name])</h1>
-
-	<p>
-		从R95版本起,three.js便开始支持使用WebGL 2环境来进行渲染。默认情况下,当创建一个*WebGLRenderer*实例时,
-		three.js总是使用WebGL 1环境。如果你希望来使用WebGL 2环境,请参阅以下的工作流程。
-	</p>
-
-	<h2>工作流程</h2>
-
-	<p>
-		由于WebGL 2并不被所有支持WebGL 1的设备所支持,因此检查各种设备上WebGL 2的可用性是非常重要的。
-		要对其可用性进行检查,请将[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js WebGL.js]包含到你的项目中。
-	</p>
-
-	<code>
-import { WEBGL } from 'three/examples/jsm/WebGL.js';
-	</code>
-
-	<p>
-		接下来,使用和下列代码相似的代码来进行可用性检查。
-	</p>
-
-	<code>
-
-if ( WEBGL.isWebGL2Available() === false ) {
-
-	document.body.appendChild( WEBGL.getWebGL2ErrorMessage() );
-
-}
-	</code>
-
-	<p>
-		现在,你就可以将由*WebGLRenderer*所构造的renderer,应用到HTML5 Canvas元素和对应的WebGL 2绘图环境上了。
-		最终,three.js将在内部使用所给定的绘图环境来渲染,并自动将内置的材质的着色器代码转化为GLSL ES 3.00。
-	</p>
-
-	<p>
-		由于你是手动创建WebGL 2渲染上下文,因此还必须传入所有必需的上下文属性。
-		请注意:在上下文被创建后,将无法修改这些属性,因此将它们传递给WebGLRenderer将不会产生任何影响。
-	</p>
-
-	<code>
-var canvas = document.createElement( 'canvas' );
-var context = canvas.getContext( 'webgl2', { alpha: false } );
-var renderer = new THREE.WebGLRenderer( { canvas: canvas, context: context } );
-	</code>
-
-	<p>
-		有时候,写一些自定义着色器也是非常必要的。请使用下列的代码模板作为你自己来进行实现的基础。
-		首先是GLSL ES 3.00代码。
-	</p>
-
-	<code>
-&lt;script id="vs" type="x-shader/x-vertex"&gt;
-#version 300 es
-
-void main() {
-
-	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
-
-}
-&lt;/script&gt;
-&lt;script id="fs" type="x-shader/x-fragment"&gt;
-#version 300 es
-
-precision highp float;
-precision highp int;
-out vec4 out_FragColor;
-
-void main() {
-
-	out_FragColor = vec4( 1.0 );
-
-}
-&lt;/script&gt;
-	</code>
-	<p>
-		然后是使用JavaScript来创建的对应的材质。
-	</p>
-	<code>
-var material = new THREE.ShaderMaterial( {
-	vertexShader: document.getElementById( 'vs' ).textContent.trim(),
-	fragmentShader: document.getElementById( 'fs' ).textContent.trim()
-} );
-	</code>
-
-	<h2>接下来</h2>
-
-	<p>
-		请参阅官方示例,来看一看WebGL 2各种特性的运行。<br /><br />
-
-		[example:webgl2_materials_texture3d WebGL2 / materials / texture3d]<br />
-		[example:webgl2_materials_texture2darray WebGL2 / materials / texture2darray]<br />
-		[example:webgl2_multisampled_renderbuffers WebGL2 / multisampled renderbuffers]
-	</p>
-
-	<h2>支持的特性</h2>
-
-	<p>
-		当前,three.js引擎仅支持所有现有的WebGL 2特性的一个子集。
-		下列列表展现了在最新版本three.js中,已可用的特性的概览。
-		<ul>
-			<li>3D Textures</li>
-			<li>2D Texture Arrays</li>
-			<li>Multisampled Renderbuffers</li>
-			<li>Non-power of two (POT) textures work just the same as POT textures now. No resizing is required for best quality.</li>
-		</ul>
-
-	</p>
-
-</body>
-
-</html>