NodeFunction.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>NodeFunction - 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. <h1 translate="no">NodeFunction</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Base class for node functions. A derived module must be implemented
  16. for each supported native shader language. Similar to other <code>Node*</code> modules,
  17. this class is only relevant during the building process and not used
  18. in user-level code.</p></div>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="NodeFunction" translate="no">new <a href="#NodeFunction">NodeFunction</a><span class="signature">( type : <span class="param-type">string</span>, inputs : <span class="param-type">Array.&lt;<a href="NodeFunctionInput.html">NodeFunctionInput</a>></span>, name : <span class="param-type">string</span>, precision : <span class="param-type">string</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new node function.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name">
  32. <strong>type</strong>
  33. </td>
  34. <td class="description last">
  35. <p>The node type. This type is the return type of the node function.</p>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td class="name">
  40. <strong>inputs</strong>
  41. </td>
  42. <td class="description last">
  43. <p>The function's inputs.</p>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td class="name">
  48. <strong>name</strong>
  49. </td>
  50. <td class="description last">
  51. <p>The function's name.</p>
  52. <p>Default is <code>''</code>.</p>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td class="name">
  57. <strong>precision</strong>
  58. </td>
  59. <td class="description last">
  60. <p>The precision qualifier.</p>
  61. <p>Default is <code>''</code>.</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="inputs" translate="no">.<a href="#inputs">inputs</a><span class="type-signature"> : Array.&lt;<a href="NodeFunctionInput.html">NodeFunctionInput</a>></span> </h3>
  71. <div class="description">
  72. <p>The function's inputs.</p>
  73. </div>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  77. <div class="description">
  78. <p>The name of the uniform.</p>
  79. <p>Default is <code>''</code>.</p>
  80. </div>
  81. </div>
  82. <div class="member">
  83. <h3 class="name" id="precision" translate="no">.<a href="#precision">precision</a><span class="type-signature"> : string</span> </h3>
  84. <div class="description">
  85. <p>The precision qualifier.</p>
  86. <p>Default is <code>''</code>.</p>
  87. </div>
  88. </div>
  89. <div class="member">
  90. <h3 class="name" id="type" translate="no">.<a href="#type">type</a><span class="type-signature"> : string</span> </h3>
  91. <div class="description">
  92. <p>The node type. This type is the return type of the node function.</p>
  93. </div>
  94. </div>
  95. <h2 class="subsection-title">Methods</h2>
  96. <h3 class="name name-method" id="getCode" translate="no">.<a href="#getCode">getCode</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : string</span> <span class="type-signature">(abstract) </span></h3>
  97. <div class="method">
  98. <div class="description">
  99. <p>This method returns the native code of the node function.</p>
  100. </div>
  101. <table class="params">
  102. <tbody>
  103. <tr>
  104. <td class="name">
  105. <strong>name</strong>
  106. </td>
  107. <td class="description last">
  108. <p>The function's name.</p>
  109. </td>
  110. </tr>
  111. </tbody>
  112. </table>
  113. <dl class="details">
  114. <dt class="tag-returns"><strong>Returns:</strong> A shader code.</dt>
  115. </dl>
  116. </div>
  117. <h2 class="subsection-title">Source</h2>
  118. <p>
  119. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/NodeFunction.js" translate="no" target="_blank" rel="noopener">src/nodes/core/NodeFunction.js</a>
  120. </p>
  121. </article>
  122. </section>
  123. <script src="../scripts/linenumber.js"></script>
  124. <script src="../scripts/page.js"></script>
  125. </body>
  126. </html>
粤ICP备19079148号