PointsNodeMaterial.html 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PointsNodeMaterial - 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="Material.html">Material</a> → <a href="NodeMaterial.html">NodeMaterial</a> → <a href="SpriteNodeMaterial.html">SpriteNodeMaterial</a> → </p>
  13. <h1 translate="no">PointsNodeMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Node material version of <a href="PointsMaterial.html">PointsMaterial</a>.</p>
  17. <p>This material can be used in two ways:</p>
  18. <ul>
  19. <li>By rendering point primitives with <a href="Points.html">Points</a>. Since WebGPU only supports point primitives
  20. with a pixel size of <code>1</code>, it's not possible to define a size.</li>
  21. </ul>
  22. <ul>
  23. <li>By rendering point primitives with Sprites. In this case, size is honored,
  24. see <a href="PointsNodeMaterial.html#sizeNode">PointsNodeMaterial#sizeNode</a>.</li>
  25. </ul>
  26. <pre><code class="language-js">const instancedPoints = new THREE.Sprite( new THREE.PointsNodeMaterial( { positionNode: instancedBufferAttribute( positionAttribute ) } ) );
  27. </code></pre></div>
  28. <h2>Code Example</h2>
  29. <div translate="no"><pre><code class="language-js">const pointCloud = new THREE.Points( geometry, new THREE.PointsNodeMaterial() );
  30. </code></pre></div>
  31. </header>
  32. <article>
  33. <div class="container-overview">
  34. <h2>Constructor</h2>
  35. <h3 class="name name-method" id="PointsNodeMaterial" translate="no">new <a href="#PointsNodeMaterial">PointsNodeMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  36. <div class="method">
  37. <div class="description">
  38. <p>Constructs a new points node material.</p>
  39. </div>
  40. <table class="params">
  41. <tbody>
  42. <tr>
  43. <td class="name">
  44. <strong>parameters</strong>
  45. </td>
  46. <td class="description last">
  47. <p>The configuration parameter.</p>
  48. </td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <h3 class="name" id="alphaToCoverage" translate="no">.<a href="#alphaToCoverage">alphaToCoverage</a><span class="type-signature"> : boolean</span> </h3>
  57. <div class="description">
  58. <p>Whether alpha to coverage should be used or not.</p>
  59. <p>Default is <code>true</code>.</p>
  60. </div>
  61. <dl class="details">
  62. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="SpriteNodeMaterial.html#alphaToCoverage">SpriteNodeMaterial#alphaToCoverage</a></dt>
  63. </dl>
  64. </div>
  65. <div class="member">
  66. <h3 class="name" id="isPointsNodeMaterial" translate="no">.<a href="#isPointsNodeMaterial">isPointsNodeMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  67. <div class="description">
  68. <p>This flag can be used for type testing.</p>
  69. <p>Default is <code>true</code>.</p>
  70. </div>
  71. </div>
  72. <div class="member">
  73. <h3 class="name" id="sizeNode" translate="no">.<a href="#sizeNode">sizeNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec2></span> </h3>
  74. <div class="description">
  75. <p>This node property provides an additional way to set the point size.</p>
  76. <p>Note that WebGPU only supports point primitives with 1 pixel size. Consequently,
  77. this node has no effect when the material is used with <a href="Points.html">Points</a> and a WebGPU
  78. backend. If an application wants to render points with a size larger than 1 pixel,
  79. the material should be used with <a href="Sprite.html">Sprite</a> and instancing.</p>
  80. <p>Default is <code>null</code>.</p>
  81. </div>
  82. </div>
  83. <h2 class="subsection-title">Source</h2>
  84. <p>
  85. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/nodes/PointsNodeMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/nodes/PointsNodeMaterial.js</a>
  86. </p>
  87. </article>
  88. </section>
  89. <script src="../scripts/linenumber.js"></script>
  90. <script src="../scripts/page.js"></script>
  91. </body>
  92. </html>
粤ICP备19079148号