Browse Source

Updated docs.

Mr.doob 3 months ago
parent
commit
887eb828fd

+ 38 - 0
docs/pages/BufferNode.html

@@ -83,7 +83,45 @@ const matrixNode = bufferNode.element( index ); // access a matrix from the buff
 						<p>Default is <code>true</code>.</p>
 					</div>
 				</div>
+				<div class="member">
+					<h3 class="name" id="updateRanges" translate="no">.<a href="#updateRanges">updateRanges</a><span class="type-signature"> : Array.&lt;{start: number, count: number}></span> </h3>
+					<div class="description">
+						<p>An array of update ranges.</p>
+					</div>
+				</div>
 				<h2 class="subsection-title">Methods</h2>
+					<h3 class="name name-method" id="addUpdateRange" translate="no">.<a href="#addUpdateRange">addUpdateRange</a><span class="signature">( start : <span class="param-type">number</span>, count : <span class="param-type">number</span> )</span> </h3>
+					<div class="method">
+						<div class="description">
+							<p>Adds a range of data in the data array to be updated on the GPU.</p>
+						</div>
+						<table class="params">
+							<tbody>
+								<tr>
+									<td class="name">
+										<strong>start</strong>
+									</td>
+									<td class="description last">
+										<p>Position at which to start update.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong>count</strong>
+									</td>
+									<td class="description last">
+										<p>The number of components to update.</p>
+									</td>
+								</tr>
+							</tbody>
+						</table>
+					</div>
+					<h3 class="name name-method" id="clearUpdateRanges" translate="no">.<a href="#clearUpdateRanges">clearUpdateRanges</a><span class="signature">()</span> </h3>
+					<div class="method">
+						<div class="description">
+							<p>Clears the update ranges.</p>
+						</div>
+					</div>
 					<h3 class="name name-method" id="getElementType" translate="no">.<a href="#getElementType">getElementType</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
 					<div class="method">
 						<div class="description">

+ 14 - 2
docs/pages/InstanceNode.html

@@ -21,7 +21,7 @@ data.</p></div>
 			<article>
 				<div class="container-overview">
 					<h2>Constructor</h2>
-					<h3 class="name name-method" id="InstanceNode" translate="no">new <a href="#InstanceNode">InstanceNode</a><span class="signature">( count : <span class="param-type">number</span>, instanceMatrix : <span class="param-type"><a href="InstancedBufferAttribute.html">InstancedBufferAttribute</a></span>, instanceColor : <span class="param-type"><a href="InstancedBufferAttribute.html">InstancedBufferAttribute</a></span> )</span> </h3>
+					<h3 class="name name-method" id="InstanceNode" translate="no">new <a href="#InstanceNode">InstanceNode</a><span class="signature">( count : <span class="param-type">number</span>, instanceMatrix : <span class="param-type"><a href="InstancedBufferAttribute.html">InstancedBufferAttribute</a> | <a href="StorageInstancedBufferAttribute.html">StorageInstancedBufferAttribute</a></span>, instanceColor : <span class="param-type"><a href="InstancedBufferAttribute.html">InstancedBufferAttribute</a> | <a href="StorageInstancedBufferAttribute.html">StorageInstancedBufferAttribute</a></span> )</span> </h3>
 					<div class="method">
 						<div class="description">
 							<p>Constructs a new instance node.</p>
@@ -101,6 +101,18 @@ data.</p></div>
 						<p>The node that represents the instance matrix data.</p>
 					</div>
 				</div>
+				<div class="member">
+					<h3 class="name" id="isStorageColor" translate="no">.<a href="#isStorageColor">isStorageColor</a><span class="type-signature"> : boolean</span> </h3>
+					<div class="description">
+						<p>Tracks whether the color data is provided via a storage buffer.</p>
+					</div>
+				</div>
+				<div class="member">
+					<h3 class="name" id="isStorageMatrix" translate="no">.<a href="#isStorageMatrix">isStorageMatrix</a><span class="type-signature"> : boolean</span> </h3>
+					<div class="description">
+						<p>Tracks whether the matrix data is provided via a storage buffer.</p>
+					</div>
+				</div>
 				<div class="member">
 					<h3 class="name" id="updateType" translate="no">.<a href="#updateType">updateType</a><span class="type-signature"> : string</span> </h3>
 					<div class="description">
@@ -139,7 +151,7 @@ like with morph and skinning nodes.</p>
 					<h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
 					<div class="method">
 						<div class="description">
-							<p>Checks if the internal buffers required an update.</p>
+							<p>Checks if the internal buffers require an update.</p>
 						</div>
 						<table class="params">
 							<tbody>

+ 28 - 1
docs/pages/LDrawLoader.html

@@ -14,7 +14,34 @@
 		<section>
 			<header>
 				<div class="class-description"><p>A loader for the LDraw format.</p>
-<p>[LDraw](https://ldraw.org/} (LEGO Draw) is an <a href="https://ldraw.org/article/218.html)" target="_blank" rel="noopener">open format specification</a> from 'three/addons/loaders/LDrawLoader.js';</code></pre>
+<p>[LDraw](https://ldraw.org/} (LEGO Draw) is an <a href="https://ldraw.org/article/218.html" target="_blank" rel="noopener">open format specification</a>
+for describing LEGO and other construction set 3D models.</p>
+<p>An LDraw asset (a text file usually with extension .ldr, .dat or .txt) can describe just a single construction
+piece, or an entire model. In the case of a model the LDraw file can reference other LDraw files, which are
+loaded from a library path set with <code>setPartsLibraryPath</code>. You usually download the LDraw official parts library,
+extract to a folder and point setPartsLibraryPath to it.</p>
+<p>Library parts will be loaded by trial and error in subfolders 'parts', 'p' and 'models'. These file accesses
+are not optimal for web environment, so a script tool has been made to pack an LDraw file with all its dependencies
+into a single file, which loads much faster. See section 'Packing LDraw models'. The LDrawLoader example loads
+several packed files. The official parts library is not included due to its large size.</p>
+<p><code>LDrawLoader</code> supports the following extensions:</p>
+<ul>
+<li>!COLOUR: Color and surface finish declarations.</li>
+<li>BFC: Back Face Culling specification.</li>
+<li>!CATEGORY: Model/part category declarations.</li>
+<li>!KEYWORDS: Model/part keywords declarations.</li>
+</ul></div>
+				<h2>Code Example</h2>
+				<div translate="no"><pre><code class="language-js">const loader = new LDrawLoader();
+loader.setConditionalLineMaterial( LDrawConditionalLineMaterial ); // the type of line material depends on the used renderer
+const object = await loader.loadAsync( 'models/ldraw/officialLibrary/models/car.ldr_Packed.mpd' );
+scene.add( object );
+</code></pre></div>
+			</header>
+			<article>
+				<h2 class="subsection-title">Import</h2>
+				<p><span translate="no">LDrawLoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
+				<pre><code class="language-js">import { LDrawLoader } from 'three/addons/loaders/LDrawLoader.js';</code></pre>
 				<div class="container-overview">
 					<h2>Constructor</h2>
 					<h3 class="name name-method" id="LDrawLoader" translate="no">new <a href="#LDrawLoader">LDrawLoader</a><span class="signature">( manager : <span class="param-type"><a href="LoadingManager.html">LoadingManager</a></span> )</span> </h3>

+ 21 - 0
docs/pages/NodeBuilder.html

@@ -1992,6 +1992,27 @@ This is necessary since the renderer cache can reuse shaders generated in one ma
 							<dt class="tag-returns"><strong>Returns:</strong> The builder's current context without material.</dt>
 						</dl>
 					</div>
+					<h3 class="name name-method" id="getSharedDataFromNode" translate="no">.<a href="#getSharedDataFromNode">getSharedDataFromNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : Object</span> </h3>
+					<div class="method">
+						<div class="description">
+							<p>Returns shared data object for the given node.</p>
+						</div>
+						<table class="params">
+							<tbody>
+								<tr>
+									<td class="name">
+										<strong>node</strong>
+									</td>
+									<td class="description last">
+										<p>The node to get shared data from.</p>
+									</td>
+								</tr>
+							</tbody>
+						</table>
+						<dl class="details">
+							<dt class="tag-returns"><strong>Returns:</strong> The shared data.</dt>
+						</dl>
+					</div>
 					<h3 class="name name-method" id="getSignature" translate="no">.<a href="#getSignature">getSignature</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
 					<div class="method">
 						<div class="description">

+ 1 - 1
docs/pages/PMREMGenerator.html

@@ -200,7 +200,7 @@ and far planes ensure the scene is rendered in its entirety.</p>
 								</tr>
 								<tr>
 									<td class="name">
-										<strong>renderTarget</strong>
+										<strong>position</strong>
 									</td>
 									<td class="description last">
 										<p>The position of the internal cube camera that renders the scene.</p>

+ 1 - 1
docs/pages/Raycaster.html

@@ -375,7 +375,7 @@ intersection to the nearest point on the ray. For other objects it will be <code
 		</tr>
 		<tr>
 				<td class="name">
-					<strong>uv1</strong>
+					<strong>normal</strong>
 						<br>
 <span class="param-type"><a href="Vector3.html">Vector3</a></span>
 				</td>

+ 12 - 2
docs/pages/SkyMesh.html

@@ -15,8 +15,8 @@
 			<header>
 				<div class="class-description"><p>Represents a skydome for scene backgrounds. Based on <a href="https://www.researchgate.net/publication/220720443_A_Practical_Analytic_Model_for_Daylight" target="_blank" rel="noopener">A Practical Analytic Model for Daylight</a>
 aka The Preetham Model, the de facto standard for analytical skydomes.</p>
-<p>Note that this class can only be used with <a href="WebGLRenderer.html">WebGLRenderer</a>.
-When using <a href="WebGPURenderer.html">WebGPURenderer</a>, use <a href="SkyMesh.html">SkyMesh</a>.</p>
+<p>Note that this class can only be used with <a href="WebGPURenderer.html">WebGPURenderer</a>.
+When using <a href="WebGLRenderer.html">WebGLRenderer</a>, use <a href="Sky.html">Sky</a>.</p>
 <p>More references:</p>
 <ul>
 <li><a href="http://simonwallner.at/project/atmospheric-scattering/" target="_blank" rel="noopener">http://simonwallner.at/project/atmospheric-scattering/</a></li>
@@ -44,6 +44,16 @@ scene.add( sky );
 				<h2 class="subsection-title">Properties</h2>
 				<div class="member">
 					<h3 class="name" id="isSky" translate="no">.<a href="#isSky">isSky</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
+					<div class="description">
+						<p>This flag can be used for type testing.</p>
+						<p>Default is <code>true</code>.</p>
+					</div>
+						<dl class="details">
+							<dt class="important tag-deprecated"><strong>Deprecated:</strong> Use isSkyMesh instead.</dt>
+						</dl>
+				</div>
+				<div class="member">
+					<h3 class="name" id="isSkyMesh" translate="no">.<a href="#isSkyMesh">isSkyMesh</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
 					<div class="description">
 						<p>This flag can be used for type testing.</p>
 						<p>Default is <code>true</code>.</p>

+ 1 - 1
docs/pages/TSL.html

@@ -5173,7 +5173,7 @@ Compared to Gaussian blur, hash blur requires just a single pass.</p>
 							<dt class="tag-returns"><strong>Returns:</strong> The inspector node.</dt>
 						</dl>
 					</div>
-					<h3 class="name name-method" id="instance" translate="no">.<a href="#instance">instance</a><span class="signature">( count : <span class="param-type">number</span>, instanceMatrix : <span class="param-type"><a href="InstancedBufferAttribute.html">InstancedBufferAttribute</a></span>, instanceColor : <span class="param-type"><a href="InstancedBufferAttribute.html">InstancedBufferAttribute</a></span> )</span><span class="type-signature"> : <a href="InstanceNode.html">InstanceNode</a></span> </h3>
+					<h3 class="name name-method" id="instance" translate="no">.<a href="#instance">instance</a><span class="signature">( count : <span class="param-type">number</span>, instanceMatrix : <span class="param-type"><a href="InstancedBufferAttribute.html">InstancedBufferAttribute</a> | <a href="StorageInstancedBufferAttribute.html">StorageInstancedBufferAttribute</a></span>, instanceColor : <span class="param-type"><a href="InstancedBufferAttribute.html">InstancedBufferAttribute</a> | <a href="StorageInstancedBufferAttribute.html">StorageInstancedBufferAttribute</a></span> )</span><span class="type-signature"> : <a href="InstanceNode.html">InstanceNode</a></span> </h3>
 					<div class="method">
 						<div class="description">
 							<p>TSL function for creating an instance node.</p>

+ 17 - 0
docs/pages/Tab.html

@@ -46,6 +46,23 @@
 										<p>Default is <code>true</code>.</p>
 									</td>
 								</tr>
+								<tr>
+									<td class="name">
+										<strong>builtin</strong>
+									</td>
+									<td class="description last">
+										<p>Whether the tab should appear in the profiler-toggle button</p>
+										<p>Default is <code>false</code>.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong>icon</strong>
+									</td>
+									<td class="description last">
+										<p>SVG icon HTML for the builtin button</p>
+									</td>
+								</tr>
 							</tbody>
 						</table>
 									</td>

+ 2 - 2
docs/pages/global.html

@@ -2609,7 +2609,7 @@ between the start and end point.</p>
 							<dt class="tag-returns"><strong>Returns:</strong> Whether the given number is a power of two or not.</dt>
 						</dl>
 					</div>
-					<h3 class="name name-method" id="isTypedArray" translate="no">.<a href="#isTypedArray">isTypedArray</a><span class="signature">( object : <span class="param-type"><a href="global.html#any">any</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
+					<h3 class="name name-method" id="isTypedArray" translate="no">.<a href="#isTypedArray">isTypedArray</a><span class="signature">( array : <span class="param-type"><a href="global.html#any">any</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
 					<div class="method">
 						<div class="description">
 							<p>Returns <code>true</code> if the given object is a typed array.</p>
@@ -2618,7 +2618,7 @@ between the start and end point.</p>
 							<tbody>
 								<tr>
 									<td class="name">
-										<strong>object</strong>
+										<strong>array</strong>
 									</td>
 									<td class="description last">
 										<p>The object to check.</p>

+ 28 - 0
docs/search.json

@@ -1764,6 +1764,10 @@
 			"title": "BufferNode",
 			"kind": "class"
 		},
+		{
+			"title": "BufferNode#addUpdateRange",
+			"kind": "function"
+		},
 		{
 			"title": "BufferNode#bufferCount",
 			"kind": "member"
@@ -1772,6 +1776,10 @@
 			"title": "BufferNode#bufferType",
 			"kind": "member"
 		},
+		{
+			"title": "BufferNode#clearUpdateRanges",
+			"kind": "function"
+		},
 		{
 			"title": "BufferNode#getElementType",
 			"kind": "function"
@@ -1784,6 +1792,10 @@
 			"title": "BufferNode#isBufferNode",
 			"kind": "member"
 		},
+		{
+			"title": "BufferNode#updateRanges",
+			"kind": "member"
+		},
 		{
 			"title": "BuiltinNode",
 			"kind": "class"
@@ -4220,6 +4232,14 @@
 			"title": "InstanceNode#instanceMatrixNode",
 			"kind": "member"
 		},
+		{
+			"title": "InstanceNode#isStorageColor",
+			"kind": "member"
+		},
+		{
+			"title": "InstanceNode#isStorageMatrix",
+			"kind": "member"
+		},
 		{
 			"title": "InstanceNode#setup",
 			"kind": "function"
@@ -8080,6 +8100,10 @@
 			"title": "NodeBuilder#getSharedContext",
 			"kind": "function"
 		},
+		{
+			"title": "NodeBuilder#getSharedDataFromNode",
+			"kind": "function"
+		},
 		{
 			"title": "NodeBuilder#getSignature",
 			"kind": "function"
@@ -22094,6 +22118,10 @@
 			"title": "SkyMesh#isSky",
 			"kind": "member"
 		},
+		{
+			"title": "SkyMesh#isSkyMesh",
+			"kind": "member"
+		},
 		{
 			"title": "SkyMesh#mieCoefficient",
 			"kind": "member"

粤ICP备19079148号