GLSLNodeBuilder.html 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>GLSLNodeBuilder - 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="NodeBuilder.html">NodeBuilder</a> → </p>
  13. <h1 translate="no">GLSLNodeBuilder</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A node builder targeting GLSL.</p>
  17. <p>This module generates GLSL shader code from node materials and also
  18. generates the respective bindings and vertex buffer definitions. These
  19. data are later used by the renderer to create render and compute pipelines
  20. for render objects.</p></div>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="GLSLNodeBuilder" translate="no">new <a href="#GLSLNodeBuilder">GLSLNodeBuilder</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, renderer : <span class="param-type"><a href="Renderer.html">Renderer</a></span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new GLSL node builder renderer.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>object</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The 3D object.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong>renderer</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The renderer.</p>
  46. </td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. </div>
  51. </div>
  52. <h2 class="subsection-title">Properties</h2>
  53. <div class="member">
  54. <h3 class="name" id="builtins" translate="no">.<a href="#builtins">builtins</a><span class="type-signature"> : Object.&lt;string, Array.&lt;string>></span> </h3>
  55. <div class="description">
  56. <p>A dictionary that holds for each shader stage an Array of used builtins.</p>
  57. </div>
  58. </div>
  59. <div class="member">
  60. <h3 class="name" id="extensions" translate="no">.<a href="#extensions">extensions</a><span class="type-signature"> : Object.&lt;string, Map.&lt;string, Object>></span> </h3>
  61. <div class="description">
  62. <p>A dictionary that holds for each shader stage a Map of used extensions.</p>
  63. </div>
  64. </div>
  65. <div class="member">
  66. <h3 class="name" id="transforms" translate="no">.<a href="#transforms">transforms</a><span class="type-signature"> : Array.&lt;Object.&lt;string, (<a href="AttributeNode.html">AttributeNode</a>|string)>></span> </h3>
  67. <div class="description">
  68. <p>An array that holds objects defining the varying and attribute data in
  69. context of Transform Feedback.</p>
  70. </div>
  71. </div>
  72. <div class="member">
  73. <h3 class="name" id="uniformGroups" translate="no">.<a href="#uniformGroups">uniformGroups</a><span class="type-signature"> : Object.&lt;string, Object.&lt;string, <a href="NodeUniformsGroup.html">NodeUniformsGroup</a>>></span> </h3>
  74. <div class="description">
  75. <p>A dictionary holds for each shader stage ('vertex', 'fragment', 'compute')
  76. another dictionary which manages UBOs per group ('render','frame','object').</p>
  77. </div>
  78. </div>
  79. <h2 class="subsection-title">Methods</h2>
  80. <h3 class="name name-method" id="buildCode" translate="no">.<a href="#buildCode">buildCode</a><span class="signature">()</span> </h3>
  81. <div class="method">
  82. <div class="description">
  83. <p>Controls the code build of the shader stages.</p>
  84. </div>
  85. <dl class="details">
  86. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#buildCode">NodeBuilder#buildCode</a></dt>
  87. </dl>
  88. </div>
  89. <h3 class="name name-method" id="buildFunctionCode" translate="no">.<a href="#buildFunctionCode">buildFunctionCode</a><span class="signature">( shaderNode : <span class="param-type">ShaderNodeInternal</span> )</span><span class="type-signature"> : string</span> </h3>
  90. <div class="method">
  91. <div class="description">
  92. <p>Builds the given shader node.</p>
  93. </div>
  94. <table class="params">
  95. <tbody>
  96. <tr>
  97. <td class="name">
  98. <strong>shaderNode</strong>
  99. </td>
  100. <td class="description last">
  101. <p>The shader node.</p>
  102. </td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. <dl class="details">
  107. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#buildFunctionCode">NodeBuilder#buildFunctionCode</a></dt>
  108. </dl>
  109. <dl class="details">
  110. <dt class="tag-returns"><strong>Returns:</strong> The GLSL function code.</dt>
  111. </dl>
  112. </div>
  113. <h3 class="name name-method" id="enableExtension" translate="no">.<a href="#enableExtension">enableExtension</a><span class="signature">( name : <span class="param-type">string</span>, behavior : <span class="param-type">string</span>, shaderStage : <span class="param-type">string</span> )</span> </h3>
  114. <div class="method">
  115. <div class="description">
  116. <p>Enables the given extension.</p>
  117. </div>
  118. <table class="params">
  119. <tbody>
  120. <tr>
  121. <td class="name">
  122. <strong>name</strong>
  123. </td>
  124. <td class="description last">
  125. <p>The extension name.</p>
  126. </td>
  127. </tr>
  128. <tr>
  129. <td class="name">
  130. <strong>behavior</strong>
  131. </td>
  132. <td class="description last">
  133. <p>The extension behavior.</p>
  134. </td>
  135. </tr>
  136. <tr>
  137. <td class="name">
  138. <strong>shaderStage</strong>
  139. </td>
  140. <td class="description last">
  141. <p>The shader stage.</p>
  142. <p>Default is <code>this.shaderStage</code>.</p>
  143. </td>
  144. </tr>
  145. </tbody>
  146. </table>
  147. </div>
  148. <h3 class="name name-method" id="enableHardwareClipping" translate="no">.<a href="#enableHardwareClipping">enableHardwareClipping</a><span class="signature">( planeCount : <span class="param-type">string</span> )</span> </h3>
  149. <div class="method">
  150. <div class="description">
  151. <p>Enables hardware clipping.</p>
  152. </div>
  153. <table class="params">
  154. <tbody>
  155. <tr>
  156. <td class="name">
  157. <strong>planeCount</strong>
  158. </td>
  159. <td class="description last">
  160. <p>The clipping plane count.</p>
  161. </td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. </div>
  166. <h3 class="name name-method" id="enableMultiview" translate="no">.<a href="#enableMultiview">enableMultiview</a><span class="signature">()</span> </h3>
  167. <div class="method">
  168. <div class="description">
  169. <p>Enables multiview.</p>
  170. </div>
  171. </div>
  172. <h3 class="name name-method" id="generatePBO" translate="no">.<a href="#generatePBO">generatePBO</a><span class="signature">( storageArrayElementNode : <span class="param-type"><a href="StorageArrayElementNode.html">StorageArrayElementNode</a></span> )</span><span class="type-signature"> : string</span> </h3>
  173. <div class="method">
  174. <div class="description">
  175. <p>Setups the Pixel Buffer Object (PBO) for the given storage
  176. buffer node.</p>
  177. </div>
  178. <table class="params">
  179. <tbody>
  180. <tr>
  181. <td class="name">
  182. <strong>storageArrayElementNode</strong>
  183. </td>
  184. <td class="description last">
  185. <p>The storage array element node.</p>
  186. </td>
  187. </tr>
  188. </tbody>
  189. </table>
  190. <dl class="details">
  191. <dt class="tag-returns"><strong>Returns:</strong> The property name.</dt>
  192. </dl>
  193. </div>
  194. <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> )</span><span class="type-signature"> : string</span> </h3>
  195. <div class="method">
  196. <div class="description">
  197. <p>Generates the GLSL snippet for sampling/loading the given texture.</p>
  198. </div>
  199. <table class="params">
  200. <tbody>
  201. <tr>
  202. <td class="name">
  203. <strong>texture</strong>
  204. </td>
  205. <td class="description last">
  206. <p>The texture.</p>
  207. </td>
  208. </tr>
  209. <tr>
  210. <td class="name">
  211. <strong>textureProperty</strong>
  212. </td>
  213. <td class="description last">
  214. <p>The name of the texture uniform in the shader.</p>
  215. </td>
  216. </tr>
  217. <tr>
  218. <td class="name">
  219. <strong>uvSnippet</strong>
  220. </td>
  221. <td class="description last">
  222. <p>A GLSL snippet that represents texture coordinates used for sampling.</p>
  223. </td>
  224. </tr>
  225. <tr>
  226. <td class="name">
  227. <strong>depthSnippet</strong>
  228. </td>
  229. <td class="description last">
  230. <p>A GLSL snippet that represents the 0-based texture array index to sample.</p>
  231. </td>
  232. </tr>
  233. <tr>
  234. <td class="name">
  235. <strong>offsetSnippet</strong>
  236. </td>
  237. <td class="description last">
  238. <p>A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.</p>
  239. </td>
  240. </tr>
  241. </tbody>
  242. </table>
  243. <dl class="details">
  244. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#generateTexture">NodeBuilder#generateTexture</a></dt>
  245. </dl>
  246. <dl class="details">
  247. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet.</dt>
  248. </dl>
  249. </div>
  250. <h3 class="name name-method" id="generateTextureBias" translate="no">.<a href="#generateTextureBias">generateTextureBias</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>, biasSnippet : <span class="param-type">string</span>, offsetSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  251. <div class="method">
  252. <div class="description">
  253. <p>Generates the GLSL snippet when sampling textures with a bias to the mip level.</p>
  254. </div>
  255. <table class="params">
  256. <tbody>
  257. <tr>
  258. <td class="name">
  259. <strong>texture</strong>
  260. </td>
  261. <td class="description last">
  262. <p>The texture.</p>
  263. </td>
  264. </tr>
  265. <tr>
  266. <td class="name">
  267. <strong>textureProperty</strong>
  268. </td>
  269. <td class="description last">
  270. <p>The name of the texture uniform in the shader.</p>
  271. </td>
  272. </tr>
  273. <tr>
  274. <td class="name">
  275. <strong>uvSnippet</strong>
  276. </td>
  277. <td class="description last">
  278. <p>A GLSL snippet that represents texture coordinates used for sampling.</p>
  279. </td>
  280. </tr>
  281. <tr>
  282. <td class="name">
  283. <strong>biasSnippet</strong>
  284. </td>
  285. <td class="description last">
  286. <p>A GLSL snippet that represents the bias to apply to the mip level before sampling.</p>
  287. </td>
  288. </tr>
  289. <tr>
  290. <td class="name">
  291. <strong>offsetSnippet</strong>
  292. </td>
  293. <td class="description last">
  294. <p>A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.</p>
  295. </td>
  296. </tr>
  297. </tbody>
  298. </table>
  299. <dl class="details">
  300. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet.</dt>
  301. </dl>
  302. </div>
  303. <h3 class="name name-method" id="generateTextureCompare" translate="no">.<a href="#generateTextureCompare">generateTextureCompare</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>, compareSnippet : <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>
  304. <div class="method">
  305. <div class="description">
  306. <p>Generates the GLSL snippet for sampling a depth texture and comparing the sampled depth values
  307. against a reference value.</p>
  308. </div>
  309. <table class="params">
  310. <tbody>
  311. <tr>
  312. <td class="name">
  313. <strong>texture</strong>
  314. </td>
  315. <td class="description last">
  316. <p>The texture.</p>
  317. </td>
  318. </tr>
  319. <tr>
  320. <td class="name">
  321. <strong>textureProperty</strong>
  322. </td>
  323. <td class="description last">
  324. <p>The name of the texture uniform in the shader.</p>
  325. </td>
  326. </tr>
  327. <tr>
  328. <td class="name">
  329. <strong>uvSnippet</strong>
  330. </td>
  331. <td class="description last">
  332. <p>A GLSL snippet that represents texture coordinates used for sampling.</p>
  333. </td>
  334. </tr>
  335. <tr>
  336. <td class="name">
  337. <strong>compareSnippet</strong>
  338. </td>
  339. <td class="description last">
  340. <p>A GLSL snippet that represents the reference value.</p>
  341. </td>
  342. </tr>
  343. <tr>
  344. <td class="name">
  345. <strong>depthSnippet</strong>
  346. </td>
  347. <td class="description last">
  348. <p>A GLSL snippet that represents 0-based texture array index to sample.</p>
  349. </td>
  350. </tr>
  351. <tr>
  352. <td class="name">
  353. <strong>offsetSnippet</strong>
  354. </td>
  355. <td class="description last">
  356. <p>A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.</p>
  357. </td>
  358. </tr>
  359. <tr>
  360. <td class="name">
  361. <strong>shaderStage</strong>
  362. </td>
  363. <td class="description last">
  364. <p>The shader stage this code snippet is generated for.</p>
  365. <p>Default is <code>this.shaderStage</code>.</p>
  366. </td>
  367. </tr>
  368. </tbody>
  369. </table>
  370. <dl class="details">
  371. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet.</dt>
  372. </dl>
  373. </div>
  374. <h3 class="name name-method" id="generateTextureGrad" translate="no">.<a href="#generateTextureGrad">generateTextureGrad</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>, gradSnippet : <span class="param-type">Array.&lt;string></span>, offsetSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  375. <div class="method">
  376. <div class="description">
  377. <p>Generates the GLSL snippet for sampling/loading the given texture using explicit gradients.</p>
  378. </div>
  379. <table class="params">
  380. <tbody>
  381. <tr>
  382. <td class="name">
  383. <strong>texture</strong>
  384. </td>
  385. <td class="description last">
  386. <p>The texture.</p>
  387. </td>
  388. </tr>
  389. <tr>
  390. <td class="name">
  391. <strong>textureProperty</strong>
  392. </td>
  393. <td class="description last">
  394. <p>The name of the texture uniform in the shader.</p>
  395. </td>
  396. </tr>
  397. <tr>
  398. <td class="name">
  399. <strong>uvSnippet</strong>
  400. </td>
  401. <td class="description last">
  402. <p>A GLSL snippet that represents texture coordinates used for sampling.</p>
  403. </td>
  404. </tr>
  405. <tr>
  406. <td class="name">
  407. <strong>gradSnippet</strong>
  408. </td>
  409. <td class="description last">
  410. <p>An array holding both gradient GLSL snippets.</p>
  411. </td>
  412. </tr>
  413. <tr>
  414. <td class="name">
  415. <strong>offsetSnippet</strong>
  416. </td>
  417. <td class="description last">
  418. <p>A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.</p>
  419. </td>
  420. </tr>
  421. </tbody>
  422. </table>
  423. <dl class="details">
  424. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet.</dt>
  425. </dl>
  426. </div>
  427. <h3 class="name name-method" id="generateTextureLevel" translate="no">.<a href="#generateTextureLevel">generateTextureLevel</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>, levelSnippet : <span class="param-type">string</span>, offsetSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  428. <div class="method">
  429. <div class="description">
  430. <p>Generates the GLSL snippet when sampling textures with explicit mip level.</p>
  431. </div>
  432. <table class="params">
  433. <tbody>
  434. <tr>
  435. <td class="name">
  436. <strong>texture</strong>
  437. </td>
  438. <td class="description last">
  439. <p>The texture.</p>
  440. </td>
  441. </tr>
  442. <tr>
  443. <td class="name">
  444. <strong>textureProperty</strong>
  445. </td>
  446. <td class="description last">
  447. <p>The name of the texture uniform in the shader.</p>
  448. </td>
  449. </tr>
  450. <tr>
  451. <td class="name">
  452. <strong>uvSnippet</strong>
  453. </td>
  454. <td class="description last">
  455. <p>A GLSL snippet that represents texture coordinates used for sampling.</p>
  456. </td>
  457. </tr>
  458. <tr>
  459. <td class="name">
  460. <strong>levelSnippet</strong>
  461. </td>
  462. <td class="description last">
  463. <p>A GLSL snippet that represents the mip level, with level 0 containing a full size version of the texture.</p>
  464. </td>
  465. </tr>
  466. <tr>
  467. <td class="name">
  468. <strong>offsetSnippet</strong>
  469. </td>
  470. <td class="description last">
  471. <p>A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.</p>
  472. </td>
  473. </tr>
  474. </tbody>
  475. </table>
  476. <dl class="details">
  477. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet.</dt>
  478. </dl>
  479. </div>
  480. <h3 class="name name-method" id="generateTextureLoad" translate="no">.<a href="#generateTextureLoad">generateTextureLoad</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>
  481. <div class="method">
  482. <div class="description">
  483. <p>Generates the GLSL snippet that reads a single texel from a texture without sampling or filtering.</p>
  484. </div>
  485. <table class="params">
  486. <tbody>
  487. <tr>
  488. <td class="name">
  489. <strong>texture</strong>
  490. </td>
  491. <td class="description last">
  492. <p>The texture.</p>
  493. </td>
  494. </tr>
  495. <tr>
  496. <td class="name">
  497. <strong>textureProperty</strong>
  498. </td>
  499. <td class="description last">
  500. <p>The name of the texture uniform in the shader.</p>
  501. </td>
  502. </tr>
  503. <tr>
  504. <td class="name">
  505. <strong>uvIndexSnippet</strong>
  506. </td>
  507. <td class="description last">
  508. <p>A GLSL snippet that represents texture coordinates used for sampling.</p>
  509. </td>
  510. </tr>
  511. <tr>
  512. <td class="name">
  513. <strong>levelSnippet</strong>
  514. </td>
  515. <td class="description last">
  516. <p>A GLSL snippet that represents the mip level, with level 0 containing a full size version of the texture.</p>
  517. </td>
  518. </tr>
  519. <tr>
  520. <td class="name">
  521. <strong>depthSnippet</strong>
  522. </td>
  523. <td class="description last">
  524. <p>A GLSL snippet that represents the 0-based texture array index to sample.</p>
  525. </td>
  526. </tr>
  527. <tr>
  528. <td class="name">
  529. <strong>offsetSnippet</strong>
  530. </td>
  531. <td class="description last">
  532. <p>A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.</p>
  533. </td>
  534. </tr>
  535. </tbody>
  536. </table>
  537. <dl class="details">
  538. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet.</dt>
  539. </dl>
  540. </div>
  541. <h3 class="name name-method" id="getAttributes" translate="no">.<a href="#getAttributes">getAttributes</a><span class="signature">( shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  542. <div class="method">
  543. <div class="description">
  544. <p>Returns the shader attributes of the given shader stage as a GLSL string.</p>
  545. </div>
  546. <table class="params">
  547. <tbody>
  548. <tr>
  549. <td class="name">
  550. <strong>shaderStage</strong>
  551. </td>
  552. <td class="description last">
  553. <p>The shader stage.</p>
  554. </td>
  555. </tr>
  556. </tbody>
  557. </table>
  558. <dl class="details">
  559. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getAttributes">NodeBuilder#getAttributes</a></dt>
  560. </dl>
  561. <dl class="details">
  562. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet that defines the shader attributes.</dt>
  563. </dl>
  564. </div>
  565. <h3 class="name name-method" id="getBitcastMethod" translate="no">.<a href="#getBitcastMethod">getBitcastMethod</a><span class="signature">( type : <span class="param-type">string</span>, inputType : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  566. <div class="method">
  567. <div class="description">
  568. <p>Returns the bitcast method name for a given input and outputType.</p>
  569. </div>
  570. <table class="params">
  571. <tbody>
  572. <tr>
  573. <td class="name">
  574. <strong>type</strong>
  575. </td>
  576. <td class="description last">
  577. <p>The output type to bitcast to.</p>
  578. </td>
  579. </tr>
  580. <tr>
  581. <td class="name">
  582. <strong>inputType</strong>
  583. </td>
  584. <td class="description last">
  585. <p>The input type of the.</p>
  586. </td>
  587. </tr>
  588. </tbody>
  589. </table>
  590. <dl class="details">
  591. <dt class="tag-returns"><strong>Returns:</strong> The resolved WGSL bitcast invocation.</dt>
  592. </dl>
  593. </div>
  594. <h3 class="name name-method" id="getClipDistance" translate="no">.<a href="#getClipDistance">getClipDistance</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  595. <div class="method">
  596. <div class="description">
  597. <p>Returns the clip distances builtin.</p>
  598. </div>
  599. <dl class="details">
  600. <dt class="tag-returns"><strong>Returns:</strong> The clip distances builtin.</dt>
  601. </dl>
  602. </div>
  603. <h3 class="name name-method" id="getDrawIndex" translate="no">.<a href="#getDrawIndex">getDrawIndex</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  604. <div class="method">
  605. <div class="description">
  606. <p>Returns the draw index builtin.</p>
  607. </div>
  608. <dl class="details">
  609. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getDrawIndex">NodeBuilder#getDrawIndex</a></dt>
  610. </dl>
  611. <dl class="details">
  612. <dt class="tag-returns"><strong>Returns:</strong> The drawIndex shader string. Returns <code>null</code> if <code>WEBGL_multi_draw</code> isn't supported by the device.</dt>
  613. </dl>
  614. </div>
  615. <h3 class="name name-method" id="getExtensions" translate="no">.<a href="#getExtensions">getExtensions</a><span class="signature">( shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  616. <div class="method">
  617. <div class="description">
  618. <p>Returns the enabled extensions of the given shader stage as a GLSL string.</p>
  619. </div>
  620. <table class="params">
  621. <tbody>
  622. <tr>
  623. <td class="name">
  624. <strong>shaderStage</strong>
  625. </td>
  626. <td class="description last">
  627. <p>The shader stage.</p>
  628. </td>
  629. </tr>
  630. </tbody>
  631. </table>
  632. <dl class="details">
  633. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet that defines the enabled extensions.</dt>
  634. </dl>
  635. </div>
  636. <h3 class="name name-method" id="getFragCoord" translate="no">.<a href="#getFragCoord">getFragCoord</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  637. <div class="method">
  638. <div class="description">
  639. <p>Returns the frag coord builtin.</p>
  640. </div>
  641. <dl class="details">
  642. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getFragCoord">NodeBuilder#getFragCoord</a></dt>
  643. </dl>
  644. <dl class="details">
  645. <dt class="tag-returns"><strong>Returns:</strong> The frag coord builtin.</dt>
  646. </dl>
  647. </div>
  648. <h3 class="name name-method" id="getFragDepth" translate="no">.<a href="#getFragDepth">getFragDepth</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  649. <div class="method">
  650. <div class="description">
  651. <p>Returns the frag depth builtin.</p>
  652. </div>
  653. <dl class="details">
  654. <dt class="tag-returns"><strong>Returns:</strong> The frag depth builtin.</dt>
  655. </dl>
  656. </div>
  657. <h3 class="name name-method" id="getFrontFacing" translate="no">.<a href="#getFrontFacing">getFrontFacing</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  658. <div class="method">
  659. <div class="description">
  660. <p>Returns the front facing builtin.</p>
  661. </div>
  662. <dl class="details">
  663. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getFrontFacing">NodeBuilder#getFrontFacing</a></dt>
  664. </dl>
  665. <dl class="details">
  666. <dt class="tag-returns"><strong>Returns:</strong> The front facing builtin.</dt>
  667. </dl>
  668. </div>
  669. <h3 class="name name-method" id="getInstanceIndex" translate="no">.<a href="#getInstanceIndex">getInstanceIndex</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  670. <div class="method">
  671. <div class="description">
  672. <p>Contextually returns either the vertex stage instance index builtin
  673. or the linearized index of an compute invocation within a grid of workgroups.</p>
  674. </div>
  675. <dl class="details">
  676. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getInstanceIndex">NodeBuilder#getInstanceIndex</a></dt>
  677. </dl>
  678. <dl class="details">
  679. <dt class="tag-returns"><strong>Returns:</strong> The instance index.</dt>
  680. </dl>
  681. </div>
  682. <h3 class="name name-method" id="getInvocationLocalIndex" translate="no">.<a href="#getInvocationLocalIndex">getInvocationLocalIndex</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  683. <div class="method">
  684. <div class="description">
  685. <p>Returns a builtin representing the index of an invocation within its workgroup.</p>
  686. </div>
  687. <dl class="details">
  688. <dt class="tag-returns"><strong>Returns:</strong> The invocation local index.</dt>
  689. </dl>
  690. </div>
  691. <h3 class="name name-method" id="getInvocationSubgroupIndex" translate="no">.<a href="#getInvocationSubgroupIndex">getInvocationSubgroupIndex</a><span class="signature">()</span> </h3>
  692. <div class="method">
  693. <div class="description">
  694. <p>Returns a builtin representing the index of an invocation within its subgroup.</p>
  695. </div>
  696. </div>
  697. <h3 class="name name-method" id="getMethod" translate="no">.<a href="#getMethod">getMethod</a><span class="signature">( method : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  698. <div class="method">
  699. <div class="description">
  700. <p>Returns the native shader method name for a given generic name.</p>
  701. </div>
  702. <table class="params">
  703. <tbody>
  704. <tr>
  705. <td class="name">
  706. <strong>method</strong>
  707. </td>
  708. <td class="description last">
  709. <p>The method name to resolve.</p>
  710. </td>
  711. </tr>
  712. </tbody>
  713. </table>
  714. <dl class="details">
  715. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getMethod">NodeBuilder#getMethod</a></dt>
  716. </dl>
  717. <dl class="details">
  718. <dt class="tag-returns"><strong>Returns:</strong> The resolved GLSL method name.</dt>
  719. </dl>
  720. </div>
  721. <h3 class="name name-method" id="getOutputStructName" translate="no">.<a href="#getOutputStructName">getOutputStructName</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  722. <div class="method">
  723. <div class="description">
  724. <p>Returns the output struct name. Not relevant for GLSL.</p>
  725. </div>
  726. <dl class="details">
  727. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getOutputStructName">NodeBuilder#getOutputStructName</a></dt>
  728. </dl>
  729. </div>
  730. <h3 class="name name-method" id="getPropertyName" translate="no">.<a href="#getPropertyName">getPropertyName</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  731. <div class="method">
  732. <div class="description">
  733. <p>Returns a GLSL snippet that represents the property name of the given node.</p>
  734. </div>
  735. <table class="params">
  736. <tbody>
  737. <tr>
  738. <td class="name">
  739. <strong>node</strong>
  740. </td>
  741. <td class="description last">
  742. <p>The node.</p>
  743. </td>
  744. </tr>
  745. <tr>
  746. <td class="name">
  747. <strong>shaderStage</strong>
  748. </td>
  749. <td class="description last">
  750. <p>The shader stage this code snippet is generated for.</p>
  751. <p>Default is <code>this.shaderStage</code>.</p>
  752. </td>
  753. </tr>
  754. </tbody>
  755. </table>
  756. <dl class="details">
  757. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getPropertyName">NodeBuilder#getPropertyName</a></dt>
  758. </dl>
  759. <dl class="details">
  760. <dt class="tag-returns"><strong>Returns:</strong> The property name.</dt>
  761. </dl>
  762. </div>
  763. <h3 class="name name-method" id="getStructMembers" translate="no">.<a href="#getStructMembers">getStructMembers</a><span class="signature">( struct : <span class="param-type"><a href="StructTypeNode.html">StructTypeNode</a></span> )</span><span class="type-signature"> : string</span> </h3>
  764. <div class="method">
  765. <div class="description">
  766. <p>Returns the members of the given struct type node as a GLSL string.</p>
  767. </div>
  768. <table class="params">
  769. <tbody>
  770. <tr>
  771. <td class="name">
  772. <strong>struct</strong>
  773. </td>
  774. <td class="description last">
  775. <p>The struct type node.</p>
  776. </td>
  777. </tr>
  778. </tbody>
  779. </table>
  780. <dl class="details">
  781. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet that defines the struct members.</dt>
  782. </dl>
  783. </div>
  784. <h3 class="name name-method" id="getStructs" translate="no">.<a href="#getStructs">getStructs</a><span class="signature">( shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  785. <div class="method">
  786. <div class="description">
  787. <p>Returns the structs of the given shader stage as a GLSL string.</p>
  788. </div>
  789. <table class="params">
  790. <tbody>
  791. <tr>
  792. <td class="name">
  793. <strong>shaderStage</strong>
  794. </td>
  795. <td class="description last">
  796. <p>The shader stage.</p>
  797. </td>
  798. </tr>
  799. </tbody>
  800. </table>
  801. <dl class="details">
  802. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet that defines the structs.</dt>
  803. </dl>
  804. </div>
  805. <h3 class="name name-method" id="getSubgroupIndex" translate="no">.<a href="#getSubgroupIndex">getSubgroupIndex</a><span class="signature">()</span> </h3>
  806. <div class="method">
  807. <div class="description">
  808. <p>Returns a builtin representing the index of the current invocation's subgroup within its workgroup.</p>
  809. </div>
  810. </div>
  811. <h3 class="name name-method" id="getSubgroupSize" translate="no">.<a href="#getSubgroupSize">getSubgroupSize</a><span class="signature">()</span> </h3>
  812. <div class="method">
  813. <div class="description">
  814. <p>Returns a builtin representing the size of a subgroup within the current shader.</p>
  815. </div>
  816. </div>
  817. <h3 class="name name-method" id="getTernary" translate="no">.<a href="#getTernary">getTernary</a><span class="signature">( condSnippet : <span class="param-type">string</span>, ifSnippet : <span class="param-type">string</span>, elseSnippet : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  818. <div class="method">
  819. <div class="description">
  820. <p>Returns the native snippet for a ternary operation.</p>
  821. </div>
  822. <table class="params">
  823. <tbody>
  824. <tr>
  825. <td class="name">
  826. <strong>condSnippet</strong>
  827. </td>
  828. <td class="description last">
  829. <p>The condition determining which expression gets resolved.</p>
  830. </td>
  831. </tr>
  832. <tr>
  833. <td class="name">
  834. <strong>ifSnippet</strong>
  835. </td>
  836. <td class="description last">
  837. <p>The expression to resolve to if the condition is true.</p>
  838. </td>
  839. </tr>
  840. <tr>
  841. <td class="name">
  842. <strong>elseSnippet</strong>
  843. </td>
  844. <td class="description last">
  845. <p>The expression to resolve to if the condition is false.</p>
  846. </td>
  847. </tr>
  848. </tbody>
  849. </table>
  850. <dl class="details">
  851. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getTernary">NodeBuilder#getTernary</a></dt>
  852. </dl>
  853. <dl class="details">
  854. <dt class="tag-returns"><strong>Returns:</strong> The resolved method name.</dt>
  855. </dl>
  856. </div>
  857. <h3 class="name name-method" id="getTransforms" translate="no">.<a href="#getTransforms">getTransforms</a><span class="signature">( shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  858. <div class="method">
  859. <div class="description">
  860. <p>Returns the transforms of the given shader stage as a GLSL string.</p>
  861. </div>
  862. <table class="params">
  863. <tbody>
  864. <tr>
  865. <td class="name">
  866. <strong>shaderStage</strong>
  867. </td>
  868. <td class="description last">
  869. <p>The shader stage.</p>
  870. </td>
  871. </tr>
  872. </tbody>
  873. </table>
  874. <dl class="details">
  875. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet that defines the transforms.</dt>
  876. </dl>
  877. </div>
  878. <h3 class="name name-method" id="getTypeFromAttribute" translate="no">.<a href="#getTypeFromAttribute">getTypeFromAttribute</a><span class="signature">( attribute : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span> )</span><span class="type-signature"> : string</span> </h3>
  879. <div class="method">
  880. <div class="description">
  881. <p>Returns the type for a given buffer attribute.</p>
  882. </div>
  883. <table class="params">
  884. <tbody>
  885. <tr>
  886. <td class="name">
  887. <strong>attribute</strong>
  888. </td>
  889. <td class="description last">
  890. <p>The buffer attribute.</p>
  891. </td>
  892. </tr>
  893. </tbody>
  894. </table>
  895. <dl class="details">
  896. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getTypeFromAttribute">NodeBuilder#getTypeFromAttribute</a></dt>
  897. </dl>
  898. <dl class="details">
  899. <dt class="tag-returns"><strong>Returns:</strong> The type.</dt>
  900. </dl>
  901. </div>
  902. <h3 class="name name-method" id="getUniformFromNode" translate="no">.<a href="#getUniformFromNode">getUniformFromNode</a><span class="signature">( node : <span class="param-type"><a href="UniformNode.html">UniformNode</a></span>, type : <span class="param-type">string</span>, shaderStage : <span class="param-type">string</span>, name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="NodeUniform.html">NodeUniform</a></span> </h3>
  903. <div class="method">
  904. <div class="description">
  905. <p>This method is one of the more important ones since it's responsible
  906. for generating a matching binding instance for the given uniform node.</p>
  907. <p>These bindings are later used in the renderer to create bind groups
  908. and layouts.</p>
  909. </div>
  910. <table class="params">
  911. <tbody>
  912. <tr>
  913. <td class="name">
  914. <strong>node</strong>
  915. </td>
  916. <td class="description last">
  917. <p>The uniform node.</p>
  918. </td>
  919. </tr>
  920. <tr>
  921. <td class="name">
  922. <strong>type</strong>
  923. </td>
  924. <td class="description last">
  925. <p>The node data type.</p>
  926. </td>
  927. </tr>
  928. <tr>
  929. <td class="name">
  930. <strong>shaderStage</strong>
  931. </td>
  932. <td class="description last">
  933. <p>The shader stage.</p>
  934. </td>
  935. </tr>
  936. <tr>
  937. <td class="name">
  938. <strong>name</strong>
  939. </td>
  940. <td class="description last">
  941. <p>An optional uniform name.</p>
  942. <p>Default is <code>null</code>.</p>
  943. </td>
  944. </tr>
  945. </tbody>
  946. </table>
  947. <dl class="details">
  948. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getUniformFromNode">NodeBuilder#getUniformFromNode</a></dt>
  949. </dl>
  950. <dl class="details">
  951. <dt class="tag-returns"><strong>Returns:</strong> The node uniform object.</dt>
  952. </dl>
  953. </div>
  954. <h3 class="name name-method" id="getUniforms" translate="no">.<a href="#getUniforms">getUniforms</a><span class="signature">( shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  955. <div class="method">
  956. <div class="description">
  957. <p>Returns the uniforms of the given shader stage as a GLSL string.</p>
  958. </div>
  959. <table class="params">
  960. <tbody>
  961. <tr>
  962. <td class="name">
  963. <strong>shaderStage</strong>
  964. </td>
  965. <td class="description last">
  966. <p>The shader stage.</p>
  967. </td>
  968. </tr>
  969. </tbody>
  970. </table>
  971. <dl class="details">
  972. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getUniforms">NodeBuilder#getUniforms</a></dt>
  973. </dl>
  974. <dl class="details">
  975. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet that defines the uniforms.</dt>
  976. </dl>
  977. </div>
  978. <h3 class="name name-method" id="getVars" translate="no">.<a href="#getVars">getVars</a><span class="signature">( shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  979. <div class="method">
  980. <div class="description">
  981. <p>Returns the variables of the given shader stage as a GLSL string.</p>
  982. </div>
  983. <table class="params">
  984. <tbody>
  985. <tr>
  986. <td class="name">
  987. <strong>shaderStage</strong>
  988. </td>
  989. <td class="description last">
  990. <p>The shader stage.</p>
  991. </td>
  992. </tr>
  993. </tbody>
  994. </table>
  995. <dl class="details">
  996. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getVars">NodeBuilder#getVars</a></dt>
  997. </dl>
  998. <dl class="details">
  999. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet that defines the variables.</dt>
  1000. </dl>
  1001. </div>
  1002. <h3 class="name name-method" id="getVaryings" translate="no">.<a href="#getVaryings">getVaryings</a><span class="signature">( shaderStage : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> </h3>
  1003. <div class="method">
  1004. <div class="description">
  1005. <p>Returns the varyings of the given shader stage as a GLSL string.</p>
  1006. </div>
  1007. <table class="params">
  1008. <tbody>
  1009. <tr>
  1010. <td class="name">
  1011. <strong>shaderStage</strong>
  1012. </td>
  1013. <td class="description last">
  1014. <p>The shader stage.</p>
  1015. </td>
  1016. </tr>
  1017. </tbody>
  1018. </table>
  1019. <dl class="details">
  1020. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getVaryings">NodeBuilder#getVaryings</a></dt>
  1021. </dl>
  1022. <dl class="details">
  1023. <dt class="tag-returns"><strong>Returns:</strong> The GLSL snippet that defines the varyings.</dt>
  1024. </dl>
  1025. </div>
  1026. <h3 class="name name-method" id="getVertexIndex" translate="no">.<a href="#getVertexIndex">getVertexIndex</a><span class="signature">()</span><span class="type-signature"> : string</span> </h3>
  1027. <div class="method">
  1028. <div class="description">
  1029. <p>Returns the vertex index builtin.</p>
  1030. </div>
  1031. <dl class="details">
  1032. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#getVertexIndex">NodeBuilder#getVertexIndex</a></dt>
  1033. </dl>
  1034. <dl class="details">
  1035. <dt class="tag-returns"><strong>Returns:</strong> The vertex index.</dt>
  1036. </dl>
  1037. </div>
  1038. <h3 class="name name-method" id="isAvailable" translate="no">.<a href="#isAvailable">isAvailable</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : boolean</span> </h3>
  1039. <div class="method">
  1040. <div class="description">
  1041. <p>Whether the requested feature is available or not.</p>
  1042. </div>
  1043. <table class="params">
  1044. <tbody>
  1045. <tr>
  1046. <td class="name">
  1047. <strong>name</strong>
  1048. </td>
  1049. <td class="description last">
  1050. <p>The requested feature.</p>
  1051. </td>
  1052. </tr>
  1053. </tbody>
  1054. </table>
  1055. <dl class="details">
  1056. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#isAvailable">NodeBuilder#isAvailable</a></dt>
  1057. </dl>
  1058. <dl class="details">
  1059. <dt class="tag-returns"><strong>Returns:</strong> Whether the requested feature is supported or not.</dt>
  1060. </dl>
  1061. </div>
  1062. <h3 class="name name-method" id="isFlipY" translate="no">.<a href="#isFlipY">isFlipY</a><span class="signature">()</span><span class="type-signature"> : boolean</span> </h3>
  1063. <div class="method">
  1064. <div class="description">
  1065. <p>Whether to flip texture data along its vertical axis or not.</p>
  1066. </div>
  1067. <dl class="details">
  1068. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#isFlipY">NodeBuilder#isFlipY</a></dt>
  1069. </dl>
  1070. <dl class="details">
  1071. <dt class="tag-returns"><strong>Returns:</strong> Returns always <code>true</code> in context of GLSL.</dt>
  1072. </dl>
  1073. </div>
  1074. <h3 class="name name-method" id="needsToWorkingColorSpace" translate="no">.<a href="#needsToWorkingColorSpace">needsToWorkingColorSpace</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
  1075. <div class="method">
  1076. <div class="description">
  1077. <p>Checks if the given texture requires a manual conversion to the working color space.</p>
  1078. </div>
  1079. <table class="params">
  1080. <tbody>
  1081. <tr>
  1082. <td class="name">
  1083. <strong>texture</strong>
  1084. </td>
  1085. <td class="description last">
  1086. <p>The texture to check.</p>
  1087. </td>
  1088. </tr>
  1089. </tbody>
  1090. </table>
  1091. <dl class="details">
  1092. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeBuilder.html#needsToWorkingColorSpace">NodeBuilder#needsToWorkingColorSpace</a></dt>
  1093. </dl>
  1094. <dl class="details">
  1095. <dt class="tag-returns"><strong>Returns:</strong> Whether the given texture requires a conversion to working color space or not.</dt>
  1096. </dl>
  1097. </div>
  1098. <h3 class="name name-method" id="registerTransform" translate="no">.<a href="#registerTransform">registerTransform</a><span class="signature">( varyingName : <span class="param-type">string</span>, attributeNode : <span class="param-type"><a href="AttributeNode.html">AttributeNode</a></span> )</span> </h3>
  1099. <div class="method">
  1100. <div class="description">
  1101. <p>Registers a transform in context of Transform Feedback.</p>
  1102. </div>
  1103. <table class="params">
  1104. <tbody>
  1105. <tr>
  1106. <td class="name">
  1107. <strong>varyingName</strong>
  1108. </td>
  1109. <td class="description last">
  1110. <p>The varying name.</p>
  1111. </td>
  1112. </tr>
  1113. <tr>
  1114. <td class="name">
  1115. <strong>attributeNode</strong>
  1116. </td>
  1117. <td class="description last">
  1118. <p>The attribute node.</p>
  1119. </td>
  1120. </tr>
  1121. </tbody>
  1122. </table>
  1123. </div>
  1124. <h3 class="name name-method" id="setupPBO" translate="no">.<a href="#setupPBO">setupPBO</a><span class="signature">( storageBufferNode : <span class="param-type"><a href="StorageBufferNode.html">StorageBufferNode</a></span> )</span> </h3>
  1125. <div class="method">
  1126. <div class="description">
  1127. <p>Setups the Pixel Buffer Object (PBO) for the given storage
  1128. buffer node.</p>
  1129. </div>
  1130. <table class="params">
  1131. <tbody>
  1132. <tr>
  1133. <td class="name">
  1134. <strong>storageBufferNode</strong>
  1135. </td>
  1136. <td class="description last">
  1137. <p>The storage buffer node.</p>
  1138. </td>
  1139. </tr>
  1140. </tbody>
  1141. </table>
  1142. </div>
  1143. <h2 class="subsection-title">Source</h2>
  1144. <p>
  1145. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js" translate="no" target="_blank" rel="noopener">src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js</a>
  1146. </p>
  1147. </article>
  1148. </section>
  1149. <script src="../scripts/linenumber.js"></script>
  1150. <script src="../scripts/page.js"></script>
  1151. </body>
  1152. </html>
粤ICP备19079148号