Mr.doob 4 дней назад
Родитель
Сommit
1347d57ddb

+ 88 - 0
docs/pages/StorageTextureNode.html

@@ -134,6 +134,94 @@ is defined, the texture node is generated as normal texture.</p>
 							<dt class="tag-returns"><strong>Returns:</strong> The generated code snippet.</dt>
 						</dl>
 					</div>
+					<h3 class="name name-method" id="generateSnippet" translate="no">.<a href="#generateSnippet">generateSnippet</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span>, textureProperty : <span class="param-type">string</span>, uvSnippet : <span class="param-type">string</span>, levelSnippet : <span class="param-type">string</span>, biasSnippet : <span class="param-type">string</span>, depthSnippet : <span class="param-type">string</span>, compareSnippet : <span class="param-type">string</span>, gradSnippet : <span class="param-type">Array.&lt;string></span>, offsetSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
+					<div class="method">
+						<div class="description">
+							<p>Generates the snippet for the storage texture.</p>
+						</div>
+						<table class="params">
+							<tbody>
+								<tr>
+									<td class="name">
+										<strong translate="no">builder</strong>
+									</td>
+									<td class="description last">
+										<p>The current node builder.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">textureProperty</strong>
+									</td>
+									<td class="description last">
+										<p>The texture property.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">uvSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>The uv snippet.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">levelSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>The level snippet.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">biasSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>The bias snippet.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">depthSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>The depth snippet.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">compareSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>The compare snippet.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">gradSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>The grad snippet.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">offsetSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>The offset snippet.</p>
+									</td>
+								</tr>
+							</tbody>
+						</table>
+						<dl class="details">
+							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="TextureNode.html#generateSnippet">TextureNode#generateSnippet</a></dt>
+						</dl>
+						<dl class="details">
+							<dt class="tag-returns"><strong>Returns:</strong> The generated code snippet.</dt>
+						</dl>
+					</div>
 					<h3 class="name name-method" id="generateStore" translate="no">.<a href="#generateStore">generateStore</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span> </h3>
 					<div class="method">
 						<div class="description">

+ 44 - 0
docs/pages/StorageTextureNode.html.md

@@ -88,6 +88,50 @@ The current output.
 
 **Returns:** The generated code snippet.
 
+### .generateSnippet( builder : NodeBuilder, textureProperty : string, uvSnippet : string, levelSnippet : string, biasSnippet : string, depthSnippet : string, compareSnippet : string, gradSnippet : Array.<string>, offsetSnippet : string ) : string
+
+Generates the snippet for the storage texture.
+
+**builder**
+
+The current node builder.
+
+**textureProperty**
+
+The texture property.
+
+**uvSnippet**
+
+The uv snippet.
+
+**levelSnippet**
+
+The level snippet.
+
+**biasSnippet**
+
+The bias snippet.
+
+**depthSnippet**
+
+The depth snippet.
+
+**compareSnippet**
+
+The compare snippet.
+
+**gradSnippet**
+
+The grad snippet.
+
+**offsetSnippet**
+
+The offset snippet.
+
+**Overrides:** [TextureNode#generateSnippet](TextureNode.html#generateSnippet)
+
+**Returns:** The generated code snippet.
+
 ### .generateStore( builder : NodeBuilder )
 
 Generates the code snippet of the storage texture node.

+ 61 - 0
docs/pages/WGSLNodeBuilder.html

@@ -286,6 +286,67 @@ This ensures the same binding index is used across all shader stages.</p>
 							<dt class="tag-returns"><strong>Returns:</strong> The WGSL snippet.</dt>
 						</dl>
 					</div>
+					<h3 class="name name-method" id="generateStorageTextureLoad" translate="no">.<a href="#generateStorageTextureLoad">generateStorageTextureLoad</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span>, textureProperty : <span class="param-type">string</span>, uvIndexSnippet : <span class="param-type">string</span>, levelSnippet : <span class="param-type">string</span>, depthSnippet : <span class="param-type">string</span>, offsetSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
+					<div class="method">
+						<div class="description">
+							<p>Generates the WGSL snippet that reads a single texel from a storage texture.</p>
+						</div>
+						<table class="params">
+							<tbody>
+								<tr>
+									<td class="name">
+										<strong translate="no">texture</strong>
+									</td>
+									<td class="description last">
+										<p>The texture.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">textureProperty</strong>
+									</td>
+									<td class="description last">
+										<p>The name of the texture uniform in the shader.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">uvIndexSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>A WGSL snippet that represents texture coordinates used for sampling.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">levelSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">depthSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>A WGSL snippet that represents 0-based texture array index to sample.</p>
+									</td>
+								</tr>
+								<tr>
+									<td class="name">
+										<strong translate="no">offsetSnippet</strong>
+									</td>
+									<td class="description last">
+										<p>A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.</p>
+									</td>
+								</tr>
+							</tbody>
+						</table>
+						<dl class="details">
+							<dt class="tag-returns"><strong>Returns:</strong> The WGSL snippet.</dt>
+						</dl>
+					</div>
 					<h3 class="name name-method" id="generateTexture" translate="no">.<a href="#generateTexture">generateTexture</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span>, textureProperty : <span class="param-type">string</span>, uvSnippet : <span class="param-type">string</span>, depthSnippet : <span class="param-type">string</span>, offsetSnippet : <span class="param-type">string</span>, shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
 					<div class="method">
 						<div class="description">

+ 30 - 0
docs/pages/WGSLNodeBuilder.html.md

@@ -152,6 +152,36 @@ A WGSL snippet that represents 0-based texture array index to sample.
 
 **Returns:** The WGSL snippet.
 
+### .generateStorageTextureLoad( texture : Texture, textureProperty : string, uvIndexSnippet : string, levelSnippet : string, depthSnippet : string, offsetSnippet : string ) : string
+
+Generates the WGSL snippet that reads a single texel from a storage texture.
+
+**texture**
+
+The texture.
+
+**textureProperty**
+
+The name of the texture uniform in the shader.
+
+**uvIndexSnippet**
+
+A WGSL snippet that represents texture coordinates used for sampling.
+
+**levelSnippet**
+
+A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture.
+
+**depthSnippet**
+
+A WGSL snippet that represents 0-based texture array index to sample.
+
+**offsetSnippet**
+
+A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.
+
+**Returns:** The WGSL snippet.
+
 ### .generateTexture( texture : Texture, textureProperty : string, uvSnippet : string, depthSnippet : string, offsetSnippet : string, shaderStage : string ) : string
 
 Generates the WGSL snippet for sampling/loading the given texture.

+ 8 - 0
docs/search.json

@@ -12704,6 +12704,10 @@
 			"title": "StorageTextureNode#generate",
 			"kind": "function"
 		},
+		{
+			"title": "StorageTextureNode#generateSnippet",
+			"kind": "function"
+		},
 		{
 			"title": "StorageTextureNode#generateStore",
 			"kind": "function"
@@ -14824,6 +14828,10 @@
 			"title": "WGSLNodeBuilder#generateFilteredTexture",
 			"kind": "function"
 		},
+		{
+			"title": "WGSLNodeBuilder#generateStorageTextureLoad",
+			"kind": "function"
+		},
 		{
 			"title": "WGSLNodeBuilder#generateTexture",
 			"kind": "function"

粤ICP备19079148号