浏览代码

Clarify dispose() method (#24654)

WestLangley 2 年之前
父节点
当前提交
561c61ce09

+ 1 - 2
docs/api/en/core/BufferGeometry.html

@@ -221,8 +221,7 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		When a BufferGeometry is rendered, it allocates WebGL resources which can only be disposed of by calling this method.
-		For more details read: [link:https://threejs.org/docs/index.html#manual/en/introduction/How-to-dispose-of-objects How to dispose of objects].
+		Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h3>[method:BufferAttribute getAttribute]( [param:String name] )</h3>

+ 1 - 1
docs/api/en/extras/PMREMGenerator.html

@@ -94,7 +94,7 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-			Disposes of the PMREMGenerator's internal memory.
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h2>Source</h2>

+ 1 - 1
docs/api/en/helpers/AxesHelper.html

@@ -51,7 +51,7 @@ scene.add( axesHelper );
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Disposes of the internally-created [page:Line.material material] and [page:Line.geometry geometry] used by this helper.
+		Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h2>Source</h2>

+ 1 - 1
docs/api/en/helpers/CameraHelper.html

@@ -61,7 +61,7 @@ scene.add( helper );
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-			Disposes of the internally-created [page:Line.material material] and [page:Line.geometry geometry] used by this helper.
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h3>[method:this setColors]( [param:Color frustum], [param:Color cone], [param:Color up], [param:Color target], [param:Color cross] )</h3>

+ 3 - 1
docs/api/en/helpers/DirectionalLightHelper.html

@@ -68,7 +68,9 @@
 		<p>See the base [page:Object3D] class for common properties.</p>
 
 		<h3>[method:undefined dispose]()</h3>
-		<p>Dispose of the directionalLightHelper.</p>
+		<p>
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
+		</p>
 
 
 		<h3>[method:undefined update]()</h3>

+ 3 - 1
docs/api/en/helpers/HemisphereLightHelper.html

@@ -62,7 +62,9 @@
 		<p>See the base [page:Object3D] class for common methods.</p>
 
 		<h3>[method:undefined dispose]()</h3>
-		<p>Dispose of the hemisphereLightHelper.</p>
+		<p>
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
+		</p>
 
 		<h3>[method:undefined update]()</h3>
 		<p>Updates the helper to match the position and direction of the [page:.light].</p>

+ 3 - 1
docs/api/en/helpers/PointLightHelper.html

@@ -70,7 +70,9 @@
 		<p>See the base [page:Mesh] class for common methods.</p>
 
 		<h3>[method:undefined dispose]()</h3>
-		<p>Dispose of the pointLightHelper.</p>
+		<p>
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
+		</p>
 
 
 		<h3>[method:undefined update]()</h3>

+ 3 - 1
docs/api/en/helpers/SpotLightHelper.html

@@ -66,7 +66,9 @@
 		<p>See the base [page:Object3D] class for common methods.</p>
 
 		<h3>[method:undefined dispose]()</h3>
-		<p>Disposes of the light helper.</p>
+		<p>
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
+		</p>
 
 		<h3>[method:undefined update]()</h3>
 		<p>Updates the light helper.</p>

+ 1 - 2
docs/api/en/lights/DirectionalLight.html

@@ -124,8 +124,7 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Override of base class's [page:Light.dispose dispose].
-		Disposes of this light's [page:DirectionalLightShadow shadow].
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h3>[method:this copy]( [param:DirectionalLight source] )</h3>

+ 1 - 1
docs/api/en/lights/Light.html

@@ -58,7 +58,7 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Abstract dispose method for lights; implemented by subclasses that have disposable resources.
+		Abstract dispose method for classes that extend this class; implemented by subclasses that have disposable GPU-related resources.
 		</p>
 
 		<h3>[method:this copy]( [param:Light source] )</h3>

+ 1 - 2
docs/api/en/lights/PointLight.html

@@ -113,8 +113,7 @@ scene.add( light );
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Override of base class's [page:Light.dispose dispose].
-		Disposes of this light's [page:PointLightShadow shadow].
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h3>[method:this copy]( [param:PointLight source] )</h3>

+ 1 - 2
docs/api/en/lights/SpotLight.html

@@ -185,8 +185,7 @@ light.target = targetObject;
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Override of base class's [page:Light.dispose dispose].
-		Disposes of this light's [page:SpotLightShadow shadow].
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h3>[method:this copy]( [param:SpotLight source] )</h3>

+ 1 - 1
docs/api/en/lights/shadows/LightShadow.html

@@ -129,7 +129,7 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Disposes of this shadow's textures ([page:LightShadow.map map] and [page:LightShadow.mapPass mapPass]).
+		Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h3>[method:this copy]( [param:LightShadow source] )</h3>

+ 4 - 2
docs/api/en/materials/Material.html

@@ -323,8 +323,10 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		This disposes the material. Textures of a material don't get disposed.
-		These needs to be disposed by [page:Texture Texture].
+		Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
+		</p>
+		<p>
+		Material textures must be be disposed of by the dispose() method of [page:Texture Texture].</p>
 		</p>
 
 		<h3>[method:undefined onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] )</h3>

+ 1 - 1
docs/api/en/objects/InstancedMesh.html

@@ -69,7 +69,7 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-			Frees the internal resources of this instance.
+			Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h3>[method:undefined getColorAt]( [param:Integer index], [param:Color color] )</h3>

+ 1 - 1
docs/api/en/objects/Skeleton.html

@@ -115,7 +115,7 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Can be used if an instance of [name] becomes obsolete in an application. The method will free internal resources.
+		Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h2>Source</h2>

+ 1 - 5
docs/api/en/renderers/WebGLRenderTarget.html

@@ -123,13 +123,9 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Dispatches a dispose event.
+		Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
-
-
-
-
 		<p>[page:EventDispatcher EventDispatcher] methods are available on this class.</p>
 
 		<h2>Source</h2>

+ 3 - 1
docs/api/en/renderers/WebGLRenderer.html

@@ -310,7 +310,9 @@
 		<p>Copies the pixels of a texture in the bounds '[page:Box3 sourceBox]' in the destination texture starting from the given position. Enables access to [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D WebGL2RenderingContext.texSubImage3D].</p>
 
 		<h3>[method:undefined dispose]( )</h3>
-		<p>Dispose of the current rendering context.</p>
+		<p>
+		Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
+		</p>
 
 		<h3>[method:undefined forceContextLoss]()</h3>
 		<p>

+ 1 - 1
docs/api/en/textures/Texture.html

@@ -303,7 +303,7 @@
 
 		<h3>[method:undefined dispose]()</h3>
 		<p>
-		Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
+		Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
 		</p>
 
 		<h3>[method:Vector2 transformUv]( [param:Vector2 uv] )</h3>