PropertyNode.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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"><code>nodeType</code></td>
  36. <td class="description last"><p>The type of the node.</p></td>
  37. </tr>
  38. <tr>
  39. <td class="name"><code>name</code></td>
  40. <td class="description last"><p>The name of the property in the shader.<br/>Default is <code>null</code>.</p></td>
  41. </tr>
  42. <tr>
  43. <td class="name"><code>varying</code></td>
  44. <td class="description last"><p>Whether this property is a varying or not.<br/>Default is <code>false</code>.</p></td>
  45. </tr>
  46. </tbody>
  47. </table>
  48. </div>
  49. </div>
  50. <h2 class="subsection-title">Properties</h2>
  51. <div class="member">
  52. <h3 class="name" id="global" translate="no">.<a href="#global">global</a><span class="type-signature"> : boolean</span> </h3>
  53. <div class="description">
  54. <p>This flag is used for global cache.<br/>Default is <code>true</code>.</p>
  55. </div>
  56. <dl class="details">
  57. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#global">Node#global</a></dt>
  58. </dl>
  59. </div>
  60. <div class="member">
  61. <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>
  62. <div class="description">
  63. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  64. </div>
  65. </div>
  66. <div class="member">
  67. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  68. <div class="description">
  69. <p>The name of the property in the shader. If no name is defined,
  70. the node system auto-generates one.<br/>Default is <code>null</code>.</p>
  71. </div>
  72. <dl class="details">
  73. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#name">Node#name</a></dt>
  74. </dl>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="varying" translate="no">.<a href="#varying">varying</a><span class="type-signature"> : boolean</span> </h3>
  78. <div class="description">
  79. <p>Whether this property is a varying or not.<br/>Default is <code>false</code>.</p>
  80. </div>
  81. </div>
  82. <h2 class="subsection-title">Source</h2>
  83. <p>
  84. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/PropertyNode.js" target="_blank" rel="noopener" translate="no">src/nodes/core/PropertyNode.js</a>
  85. </p>
  86. </article>
  87. </section>
  88. <script src="../scripts/linenumber.js"></script>
  89. <script src="../scripts/page.js"></script>
  90. </body>
  91. </html>
粤ICP备19079148号