瀏覽代碼

Created documentation for DepthTexture (#10017)

* Created documentation for DepthTexture

* pulled upstream

* added missing comma to docs/list.js
Lewy Blue 8 年之前
父節點
當前提交
bb770301a1
共有 2 個文件被更改,包括 119 次插入0 次删除
  1. 118 0
      docs/api/textures/DepthTexture.html
  2. 1 0
      docs/list.js

+ 118 - 0
docs/api/textures/DepthTexture.html

@@ -0,0 +1,118 @@
+<!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>
+		[page:Texture] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		Creates a texture for use as a Depth Texture. Require support for the
+    <a href="https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/">WEBGL_depth_texture</a>
+    extension. According to <a href="https://webglstats.com/">WebGLStats</a>, as of February 2016 around 85%
+    of WebGL enabled devices support this.
+    <br /><br />
+
+			</div>
+
+    <h2>Example</h2>
+
+    [example:webgl_depth_texture depth / texture]
+
+		<h2>Constructor</h2>
+		<h3>[name]( [page:Number width], [page:Number height], [page:Constant type], [page:Constant wrapS], [page:Constant wrapT], [page:Constant magFilter], [page:Constant minFilter], [page:Number anisotropy], [page:Constant format] )</h3>
+
+    <div>
+		[page:Number width] -- width of the texture.<br />
+
+		[page:Number height] -- height of the texture.<br />
+
+    [page:Constant type] -- Default is [page:Textures THREE.UnsignedShortType].
+     See [page:Textures type constants] for other choices.<br />
+
+    [page:Constant mapping] --
+    See [page:Textures type constants] for details.<br />
+
+    [page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
+		The default is [page:Textures THREE.NearestFilter]. See [page:Textures magnification filter constants] for other choices.<br />
+
+		[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
+		 The default is [page:Textures THREE.NearestFilter]. See [page:Textures minification filter constants] for other choices.<br />
+
+     [page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
+     By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
+     Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br />
+
+    [page:Constant format] -- must be either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
+     See [page:Textures format constants] for details.<br />
+
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<div>
+    See the base [page:Texture Texture] class for common properties
+    - the following are also part of the texture class, but have different defaults here.
+    </div>
+
+		<h3>[page:Texture.format .format]</h3>
+		<div>
+    Either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
+    See [page:Textures format constants] for details.<br />
+		</div>
+
+    <h3>[page:Texture.type .type]</h3>
+    <div>
+    Default is [page:Textures THREE.UnsignedShortType].
+    See [page:Textures format constants] for details.<br />
+    </div>
+
+    <h3>[page:Texture.magFilter .magFilter]</h3>
+    <div>
+      How the texture is sampled when a texel covers more than one pixel.
+  		The default is [page:Textures THREE.NearestFilter].
+      See [page:Textures magnification filter constants] for other choices.
+    </div>
+
+    <h3>[page:Texture.minFilter .minFilter]</h3>
+    <div>
+    How the texture is sampled when a texel covers less than one pixel.
+  	The default is [page:Textures THREE.NearestFilter].
+    See [page:Textures magnification filter constants] for other choices.
+    </div>
+
+    <h3>[page:Texture.flipY .flipY]</h3>
+    <div>
+    Depth textures do not need to be flipped so this is *false* by default.
+    </div>
+
+    <h3>[page:Texture.generateMipmaps .generateMipmaps]</h3>
+    <div>
+    Depth textures do not use mipmaps.
+    </div>
+
+		<h2>Methods</h2>
+
+    <div>
+    See the base [page:Texture Texture] class for common methods.
+    </div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 1 - 0
docs/list.js

@@ -201,6 +201,7 @@ var list = {
 			[ "CompressedTexture", "api/textures/CompressedTexture" ],
 			[ "CompressedTexture", "api/textures/CompressedTexture" ],
 			[ "CubeTexture", "api/textures/CubeTexture" ],
 			[ "CubeTexture", "api/textures/CubeTexture" ],
 			[ "DataTexture", "api/textures/DataTexture" ],
 			[ "DataTexture", "api/textures/DataTexture" ],
+			[ "DepthTexture", "api/textures/DepthTexture" ],
 			[ "Texture", "api/textures/Texture" ],
 			[ "Texture", "api/textures/Texture" ],
 			[ "VideoTexture", "api/textures/VideoTexture" ]
 			[ "VideoTexture", "api/textures/VideoTexture" ]
 		],
 		],