PropertyNode.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PropertyNode - 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> → </p>
  13. <h1 translate="no">PropertyNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class represents a shader property. It can be used
  17. to explicitly define a property and assign a value to it.</p>
  18. <p><code>PropertyNode</code> is used by the engine to predefined common material properties
  19. for TSL code.</p></div>
  20. <h2>Code Example</h2>
  21. <div translate="no"><pre><code class="language-js">const threshold = property( 'float', 'threshold' ).assign( THRESHOLD );
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="PropertyNode" translate="no">new <a href="#PropertyNode">PropertyNode</a><span class="signature">( nodeType : <span class="param-type">string</span>, name : <span class="param-type">string</span>, varying : <span class="param-type">boolean</span> )</span> </h3>
  28. <div class="method">
  29. <div class="description">
  30. <p>Constructs a new property node.</p>
  31. </div>
  32. <table class="params">
  33. <tbody>
  34. <tr>
  35. <td class="name">
  36. <strong>nodeType</strong>
  37. </td>
  38. <td class="description last">
  39. <p>The type of the node.</p>
  40. </td>
  41. </tr>
  42. <tr>
  43. <td class="name">
  44. <strong>name</strong>
  45. </td>
  46. <td class="description last">
  47. <p>The name of the property in the shader.</p>
  48. <p>Default is <code>null</code>.</p>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td class="name">
  53. <strong>varying</strong>
  54. </td>
  55. <td class="description last">
  56. <p>Whether this property is a varying or not.</p>
  57. <p>Default is <code>false</code>.</p>
  58. </td>
  59. </tr>
  60. </tbody>
  61. </table>
  62. </div>
  63. </div>
  64. <h2 class="subsection-title">Properties</h2>
  65. <div class="member">
  66. <h3 class="name" id="global" translate="no">.<a href="#global">global</a><span class="type-signature"> : boolean</span> </h3>
  67. <div class="description">
  68. <p>This flag is used for global cache.</p>
  69. <p>Default is <code>true</code>.</p>
  70. </div>
  71. <dl class="details">
  72. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#global">Node#global</a></dt>
  73. </dl>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="isPropertyNode" translate="no">.<a href="#isPropertyNode">isPropertyNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  77. <div class="description">
  78. <p>This flag can be used for type testing.</p>
  79. <p>Default is <code>true</code>.</p>
  80. </div>
  81. </div>
  82. <div class="member">
  83. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  84. <div class="description">
  85. <p>The name of the property in the shader. If no name is defined,
  86. the node system auto-generates one.</p>
  87. <p>Default is <code>null</code>.</p>
  88. </div>
  89. <dl class="details">
  90. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#name">Node#name</a></dt>
  91. </dl>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="varying" translate="no">.<a href="#varying">varying</a><span class="type-signature"> : boolean</span> </h3>
  95. <div class="description">
  96. <p>Whether this property is a varying or not.</p>
  97. <p>Default is <code>false</code>.</p>
  98. </div>
  99. </div>
  100. <h2 class="subsection-title">Source</h2>
  101. <p>
  102. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/PropertyNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/PropertyNode.js</a>
  103. </p>
  104. </article>
  105. </section>
  106. <script src="../scripts/linenumber.js"></script>
  107. <script src="../scripts/page.js"></script>
  108. </body>
  109. </html>
粤ICP备19079148号