SSRNode.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SSRNode - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="TempNode.html">TempNode</a> → </p>
  13. <h1 translate="no">SSRNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for computing screen space reflections (SSR).</p>
  17. <p>Reference: <a href="https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html" target="_blank" rel="noopener">https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html</a></p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <p><span translate="no">SSRNode</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>
  22. <pre><code class="language-js">import { ssr } from 'three/addons/tsl/display/SSRNode.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="SSRNode" translate="no">new <a href="#SSRNode">SSRNode</a><span class="signature">( colorNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec4></span>, depthNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span>, normalNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec3></span>, options : <span class="param-type"><a href="global.html#SSRNodeOptions">SSRNodeOptions</a></span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new SSR node.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong translate="no">colorNode</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The node that represents the beauty pass.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong translate="no">depthNode</strong>
  43. </td>
  44. <td class="description last">
  45. <p>A node that represents the beauty pass's depth.</p>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="name">
  50. <strong translate="no">normalNode</strong>
  51. </td>
  52. <td class="description last">
  53. <p>A node that represents the beauty pass's normals.</p>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td class="name">
  58. <strong translate="no">options</strong>
  59. </td>
  60. <td class="description last">
  61. <p>Optional inputs for material and environment data.</p>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Properties</h2>
  69. <div class="member">
  70. <h3 class="name" id="_binaryRefine" translate="no">.<a href="#_binaryRefine">_binaryRefine</a><span class="type-signature"> : boolean</span> </h3>
  71. <div class="description">
  72. <p>Enables sub-step binary-search refinement of a detected hit. When on, a coarse
  73. crossing is bisected toward the exact intersection (sharper hits, less step
  74. aliasing) at the cost of extra depth samples. Baked into the shader as a
  75. compile-time constant; assigning a new value rebuilds the SSR material.</p>
  76. <p>Default is <code>false</code>.</p>
  77. </div>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="_blurQuality" translate="no">.<a href="#_blurQuality">_blurQuality</a><span class="type-signature"> : number</span> </h3>
  81. <div class="description">
  82. <p>The quality of the blur. Must be an integer in the range <code>[1,3]</code>.</p>
  83. <p>Baked into the blur shader as a compile-time constant so the <code>(size*2+1)²</code>
  84. sample loop unrolls; assigning a new value recompiles the blur material.</p>
  85. <p>Default is <code>2</code>.</p>
  86. </div>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="_reflectNonMetals" translate="no">.<a href="#_reflectNonMetals">_reflectNonMetals</a><span class="type-signature"> : boolean</span> </h3>
  90. <div class="description">
  91. <p>Only used when <a href="SSRNode.html#stochastic">SSRNode#stochastic</a> is <code>false</code>. When <code>false</code>, non-metallic
  92. surfaces are discarded for a noticeable performance gain; set <code>true</code> to also
  93. reflect dielectrics. Baked into the shader as a compile-time constant; assigning a
  94. new value recompiles the SSR material.</p>
  95. <p>Default is <code>false</code>.</p>
  96. </div>
  97. </div>
  98. <div class="member">
  99. <h3 class="name" id="_screenEdgeFadeBlack" translate="no">.<a href="#_screenEdgeFadeBlack">_screenEdgeFadeBlack</a><span class="type-signature"> : boolean</span> </h3>
  100. <div class="description">
  101. <p>When <code>true</code>, SSR fades to zero near screen borders instead of blending toward
  102. the environment map. Hits are faded by the reflection sample UV; misses are
  103. faded by the surface pixel UV.</p>
  104. <p>Baked into the shader as a compile-time constant so the unused fade branch is
  105. eliminated; assigning a new value recompiles the SSR material.</p>
  106. <p>Default is <code>false</code>.</p>
  107. </div>
  108. </div>
  109. <div class="member">
  110. <h3 class="name" id="_stepExponent" translate="no">.<a href="#_stepExponent">_stepExponent</a><span class="type-signature"> : number</span> </h3>
  111. <div class="description">
  112. <p>Non-linear step distribution exponent. <code>1</code> = uniform steps; <code>&gt; 1</code> concentrates
  113. samples near the ray origin — where most short-range reflections are missed — and
  114. spaces them out toward maxDistance, as <code>s = (i / steps) ^ stepExponent</code>.</p>
  115. <p>Baked into the shader as a compile-time constant so <code>pow()</code> folds to a few
  116. multiplies; assigning a new value recompiles the SSR material. Only used by the
  117. stochastic reflection path.</p>
  118. <p>Default is <code>2</code>.</p>
  119. </div>
  120. </div>
  121. <div class="member">
  122. <h3 class="name" id="binaryRefine" translate="no">.<a href="#binaryRefine">binaryRefine</a><span class="type-signature"> : boolean</span> </h3>
  123. <div class="description">
  124. <p>Whether sub-step binary-search hit refinement is enabled (compile-time constant).
  125. Assigning a new value rebuilds the SSR material.</p>
  126. </div>
  127. </div>
  128. <div class="member">
  129. <h3 class="name" id="blurQuality" translate="no">.<a href="#blurQuality">blurQuality</a><span class="type-signature"> : number</span> </h3>
  130. <div class="description">
  131. <p>Blur kernel size (compile-time constant). Assigning a new value recompiles the
  132. blur material.</p>
  133. </div>
  134. </div>
  135. <div class="member">
  136. <h3 class="name" id="camera" translate="no">.<a href="#camera">camera</a><span class="type-signature"> : <a href="Camera.html">Camera</a></span> </h3>
  137. <div class="description">
  138. <p>The camera the scene is rendered with.</p>
  139. </div>
  140. </div>
  141. <div class="member">
  142. <h3 class="name" id="colorNode" translate="no">.<a href="#colorNode">colorNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec4></span> </h3>
  143. <div class="description">
  144. <p>The node that represents the beauty pass.</p>
  145. </div>
  146. </div>
  147. <div class="member">
  148. <h3 class="name" id="depthNode" translate="no">.<a href="#depthNode">depthNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  149. <div class="description">
  150. <p>A node that represents the beauty pass's depth.</p>
  151. </div>
  152. </div>
  153. <div class="member">
  154. <h3 class="name" id="diffuseNode" translate="no">.<a href="#diffuseNode">diffuseNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec4></span> </h3>
  155. <div class="description">
  156. <p>A node that represents the scene's diffuse color (typically the MRT <code>diffuseColor</code> attachment).
  157. When <code>null</code>, the shader uses <code>vec3(1)</code>.</p>
  158. </div>
  159. </div>
  160. <div class="member">
  161. <h3 class="name" id="envImportanceSampling" translate="no">.<a href="#envImportanceSampling">envImportanceSampling</a><span class="type-signature"> : boolean</span> </h3>
  162. <div class="description">
  163. <p>When <code>true</code>, env-luminance CDF tables are built and MIS is used for environment misses.
  164. Fixed at construction time.</p>
  165. </div>
  166. </div>
  167. <div class="member">
  168. <h3 class="name" id="envMapIntensity" translate="no">.<a href="#envMapIntensity">envMapIntensity</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  169. <div class="description">
  170. <p>Intensity multiplier for the importance-sampled env contribution.
  171. Only available after setEnvMap has been called.</p>
  172. </div>
  173. </div>
  174. <div class="member">
  175. <h3 class="name" id="environmentIntensity" translate="no">.<a href="#environmentIntensity">environmentIntensity</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  176. <div class="description">
  177. <p>Intensity multiplier applied to environment-map reflections on screen-space
  178. misses and at screen edges. Defaults to π to match the former hardcoded multiplier.</p>
  179. <p>Default is <code>Math.PI</code>.</p>
  180. </div>
  181. </div>
  182. <div class="member">
  183. <h3 class="name" id="environmentNode" translate="no">.<a href="#environmentNode">environmentNode</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  184. <div class="description">
  185. <p>HDR environment map for screen-space misses.</p>
  186. </div>
  187. </div>
  188. <div class="member">
  189. <h3 class="name" id="historyTexture" translate="no">.<a href="#historyTexture">historyTexture</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  190. <div class="description">
  191. <p>A node that represents the history texture for multi-bounce reflections.</p>
  192. </div>
  193. </div>
  194. <div class="member">
  195. <h3 class="name" id="intensity" translate="no">.<a href="#intensity">intensity</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  196. <div class="description">
  197. <p>A multiplier for the overall reflection intensity. <code>1</code> leaves the
  198. reflections unchanged, lower values dim them and higher values boost them.</p>
  199. <p>Default is <code>1</code>.</p>
  200. </div>
  201. </div>
  202. <div class="member">
  203. <h3 class="name" id="maxDistance" translate="no">.<a href="#maxDistance">maxDistance</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  204. <div class="description">
  205. <p>Controls how far a fragment can reflect. Increasing this value result in more
  206. computational overhead but also increases the reflection distance.</p>
  207. </div>
  208. </div>
  209. <div class="member">
  210. <h3 class="name" id="maxLuminance" translate="no">.<a href="#maxLuminance">maxLuminance</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  211. <div class="description">
  212. <p>Absolute env luminance cap. HDR env samples above this are scaled down (hue preserved).</p>
  213. <p>Default is <code>10</code>.</p>
  214. </div>
  215. </div>
  216. <div class="member">
  217. <h3 class="name" id="metalnessNode" translate="no">.<a href="#metalnessNode">metalnessNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  218. <div class="description">
  219. <p>Per-pixel metalness, used to drive the GGX reflection sampling and the non-metal
  220. early-out. When <code>null</code>, the shader treats surfaces as non-metallic.</p>
  221. </div>
  222. </div>
  223. <div class="member">
  224. <h3 class="name" id="mirrorBias" translate="no">.<a href="#mirrorBias">mirrorBias</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  225. <div class="description">
  226. <p>Mirror bias for the stochastic GGX sampling. Concentrates the reflected rays toward
  227. the lobe's narrow (near-mirror) core, trading a small amount of bias for less noise.
  228. <code>0</code> samples the full VNDF lobe; values toward <code>1</code> tighten the cone. Range <code>[0,1]</code>.</p>
  229. <p>Default is <code>0.5</code>.</p>
  230. </div>
  231. </div>
  232. <div class="member">
  233. <h3 class="name" id="normalNode" translate="no">.<a href="#normalNode">normalNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec3></span> </h3>
  234. <div class="description">
  235. <p>A node that represents the beauty pass's normals.</p>
  236. </div>
  237. </div>
  238. <div class="member">
  239. <h3 class="name" id="quality" translate="no">.<a href="#quality">quality</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  240. <div class="description">
  241. <p>This parameter controls how detailed the raymarching process works.
  242. The value ranges is <code>[0,1]</code> where <code>1</code> means best quality (the maximum number
  243. of raymarching iterations/samples) and <code>0</code> means no samples at all.</p>
  244. <p>A quality of <code>0.5</code> is usually sufficient for most use cases. Try to keep
  245. this parameter as low as possible. Larger values result in noticeable more
  246. overhead.</p>
  247. </div>
  248. </div>
  249. <div class="member">
  250. <h3 class="name" id="reflectNonMetals" translate="no">.<a href="#reflectNonMetals">reflectNonMetals</a><span class="type-signature"> : boolean</span> </h3>
  251. <div class="description">
  252. <p>Whether dielectrics are reflected in the non-stochastic path (compile-time constant).
  253. Assigning a new value rebuilds the SSR material.</p>
  254. </div>
  255. </div>
  256. <div class="member">
  257. <h3 class="name" id="resolutionScale" translate="no">.<a href="#resolutionScale">resolutionScale</a><span class="type-signature"> : number</span> </h3>
  258. <div class="description">
  259. <p>The resolution scale. Valid values are in the range
  260. <code>[0,1]</code>. <code>1</code> means best quality but also results in
  261. more computational overhead. Setting to <code>0.5</code> means
  262. the effect is computed in half-resolution.</p>
  263. <p>Default is <code>1</code>.</p>
  264. </div>
  265. </div>
  266. <div class="member">
  267. <h3 class="name" id="roughnessNode" translate="no">.<a href="#roughnessNode">roughnessNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  268. <div class="description">
  269. <p>Per-pixel roughness, used to drive the GGX reflection sampling and the blur mip
  270. selection. When <code>null</code>, the shader treats surfaces as fully smooth.</p>
  271. </div>
  272. </div>
  273. <div class="member">
  274. <h3 class="name" id="screenEdgeFade" translate="no">.<a href="#screenEdgeFade">screenEdgeFade</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  275. <div class="description">
  276. <p>Screen-edge fade width, in UV units. As a screen-space hit approaches a screen
  277. border, the reflection is faded over this distance — either toward the environment
  278. reflection (<a href="SSRNode.html#screenEdgeFadeBlack">SSRNode#screenEdgeFadeBlack</a> <code>false</code>) or to zero intensity
  279. (<code>true</code>). <code>0</code> disables it.</p>
  280. <p>Default is <code>0.2</code>.</p>
  281. </div>
  282. </div>
  283. <div class="member">
  284. <h3 class="name" id="screenEdgeFadeBlack" translate="no">.<a href="#screenEdgeFadeBlack">screenEdgeFadeBlack</a><span class="type-signature"> : boolean</span> </h3>
  285. <div class="description">
  286. <p>Whether SSR fades to black near screen borders (compile-time constant). Assigning
  287. a new value recompiles the SSR material.</p>
  288. </div>
  289. </div>
  290. <div class="member">
  291. <h3 class="name" id="stepExponent" translate="no">.<a href="#stepExponent">stepExponent</a><span class="type-signature"> : number</span> </h3>
  292. <div class="description">
  293. <p>Non-linear step distribution exponent (compile-time constant). See the backing
  294. field for details. Assigning a new value recompiles the SSR material.</p>
  295. </div>
  296. </div>
  297. <div class="member">
  298. <h3 class="name" id="stochastic" translate="no">.<a href="#stochastic">stochastic</a><span class="type-signature"> : boolean</span> </h3>
  299. <div class="description">
  300. <p>When <code>true</code>, the reflection direction is varied per pixel with stochastic GGX rays
  301. (second-generation SSR). When <code>false</code>, a single mirror reflection is traced and
  302. roughness is softened with a blur pass (first-generation SSR).</p>
  303. </div>
  304. </div>
  305. <div class="member">
  306. <h3 class="name" id="thickness" translate="no">.<a href="#thickness">thickness</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  307. <div class="description">
  308. <p>Controls the cutoff between what counts as a possible reflection hit and what does not.</p>
  309. </div>
  310. </div>
  311. <div class="member">
  312. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  313. <div class="description">
  314. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
  315. its effect once per frame in <code>updateBefore()</code>.</p>
  316. <p>Default is <code>'frame'</code>.</p>
  317. </div>
  318. <dl class="details">
  319. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  320. </dl>
  321. </div>
  322. <div class="member">
  323. <h3 class="name" id="velocityTexture" translate="no">.<a href="#velocityTexture">velocityTexture</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec2></span> </h3>
  324. <div class="description">
  325. <p>A node that represents the velocity texture for reprojection.</p>
  326. </div>
  327. </div>
  328. <h2 class="subsection-title">Methods</h2>
  329. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  330. <div class="method">
  331. <div class="description">
  332. <p>Frees internal resources. This method should be called
  333. when the effect is no longer required.</p>
  334. </div>
  335. <dl class="details">
  336. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  337. </dl>
  338. </div>
  339. <h3 class="name name-method" id="getTextureNode" translate="no">.<a href="#getTextureNode">getTextureNode</a><span class="signature">()</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  340. <div class="method">
  341. <div class="description">
  342. <p>Returns the result of the effect as a texture node.</p>
  343. </div>
  344. <dl class="details">
  345. <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
  346. </dl>
  347. </div>
  348. <h3 class="name name-method" id="setEnvMap" translate="no">.<a href="#setEnvMap">setEnvMap</a><span class="signature">( hdr : <span class="param-type"><a href="Texture.html">Texture</a> | null</span> )</span> </h3>
  349. <div class="method">
  350. <div class="description">
  351. <p>Sets the environment map for importance-sampled env lighting when
  352. screen-space rays miss. Call this whenever the scene's env map changes.</p>
  353. <p>Uses <a href="ImportanceSampledEnvironment.html">ImportanceSampledEnvironment</a> (CDF + MIS adapted from
  354. <a href="https://github.com/gkjohnson/three-gpu-pathtracer" target="_blank" rel="noopener">three-gpu-pathtracer</a>).</p>
  355. </div>
  356. <table class="params">
  357. <tbody>
  358. <tr>
  359. <td class="name">
  360. <strong translate="no">hdr</strong>
  361. </td>
  362. <td class="description last">
  363. <p>The equirectangular HDR environment map, or null to disable.</p>
  364. </td>
  365. </tr>
  366. </tbody>
  367. </table>
  368. <dl class="details">
  369. <dt class="tag-see">See:</dt>
  370. <dd class="tag-see">
  371. <ul>
  372. <li><a href="https://github.com/gkjohnson/three-gpu-pathtracer" target="_blank" rel="noopener">https://github.com/gkjohnson/three-gpu-pathtracer</a></li>
  373. </ul>
  374. </dd>
  375. </dl>
  376. </div>
  377. <h3 class="name name-method" id="setHistory" translate="no">.<a href="#setHistory">setHistory</a><span class="signature">( history : <span class="param-type"><a href="Texture.html">Texture</a></span>, velocity : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec2></span> )</span> </h3>
  378. <div class="method">
  379. <div class="description">
  380. <p>Wires the feedback inputs for multi-bounce reflections: the previous frame's
  381. denoised result (<code>history</code>) and the velocity buffer used to reproject it
  382. (<code>velocity</code>). <code>history</code> accepts the producing node (e.g. a
  383. <a href="RecurrentDenoiseNode.html">RecurrentDenoiseNode</a>) — its output render target is used — or a raw
  384. texture. Pass <code>null</code> for both to disable multi-bounce.</p>
  385. </div>
  386. <table class="params">
  387. <tbody>
  388. <tr>
  389. <td class="name">
  390. <strong translate="no">history</strong>
  391. </td>
  392. <td class="description last">
  393. </td>
  394. </tr>
  395. <tr>
  396. <td class="name">
  397. <strong translate="no">velocity</strong>
  398. </td>
  399. <td class="description last">
  400. </td>
  401. </tr>
  402. </tbody>
  403. </table>
  404. </div>
  405. <h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  406. <div class="method">
  407. <div class="description">
  408. <p>Sets the size of the effect.</p>
  409. </div>
  410. <table class="params">
  411. <tbody>
  412. <tr>
  413. <td class="name">
  414. <strong translate="no">width</strong>
  415. </td>
  416. <td class="description last">
  417. <p>The width of the effect.</p>
  418. </td>
  419. </tr>
  420. <tr>
  421. <td class="name">
  422. <strong translate="no">height</strong>
  423. </td>
  424. <td class="description last">
  425. <p>The height of the effect.</p>
  426. </td>
  427. </tr>
  428. </tbody>
  429. </table>
  430. </div>
  431. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  432. <div class="method">
  433. <div class="description">
  434. <p>This method is used to setup the effect's TSL code.</p>
  435. </div>
  436. <table class="params">
  437. <tbody>
  438. <tr>
  439. <td class="name">
  440. <strong translate="no">builder</strong>
  441. </td>
  442. <td class="description last">
  443. <p>The current node builder.</p>
  444. </td>
  445. </tr>
  446. </tbody>
  447. </table>
  448. <dl class="details">
  449. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  450. </dl>
  451. </div>
  452. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  453. <div class="method">
  454. <div class="description">
  455. <p>This method is used to render the effect once per frame.</p>
  456. </div>
  457. <table class="params">
  458. <tbody>
  459. <tr>
  460. <td class="name">
  461. <strong translate="no">frame</strong>
  462. </td>
  463. <td class="description last">
  464. <p>The current node frame.</p>
  465. </td>
  466. </tr>
  467. </tbody>
  468. </table>
  469. <dl class="details">
  470. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  471. </dl>
  472. </div>
  473. <h2 class="subsection-title">Source</h2>
  474. <p>
  475. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/SSRNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/SSRNode.js</a>
  476. </p>
  477. </article>
  478. </section>
  479. <script src="../scripts/linenumber.js"></script>
  480. <script src="../scripts/page.js"></script>
  481. </body>
  482. </html>
粤ICP备19079148号