PointsNodeMaterial.html 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. <pre><code class="language-js">const pointCloud = new THREE.Points( geometry, new THREE.PointsNodeMaterial() );
  23. </code></pre>
  24. <ul>
  25. <li>By rendering point primitives with Sprites. In this case, size is honored,
  26. see <a href="PointsNodeMaterial.html#sizeNode">PointsNodeMaterial#sizeNode</a>.</li>
  27. </ul>
  28. <pre><code class="language-js">const instancedPoints = new THREE.Sprite( new THREE.PointsNodeMaterial( { positionNode: instancedBufferAttribute( positionAttribute ) } ) );
  29. </code></pre></div>
  30. </header>
  31. <article>
  32. <div class="container-overview">
  33. <h2>Constructor</h2>
  34. <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>
  35. <div class="method">
  36. <div class="description">
  37. <p>Constructs a new points node material.</p>
  38. </div>
  39. <table class="params">
  40. <tbody>
  41. <tr>
  42. <td class="name">
  43. <strong translate="no">parameters</strong>
  44. </td>
  45. <td class="description last">
  46. <p>The configuration parameter.</p>
  47. </td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53. <h2 class="subsection-title">Properties</h2>
  54. <div class="member">
  55. <h3 class="name" id="alphaToCoverage" translate="no">.<a href="#alphaToCoverage">alphaToCoverage</a><span class="type-signature"> : boolean</span> </h3>
  56. <div class="description">
  57. <p>Whether alpha to coverage should be used or not.</p>
  58. <p>Default is <code>true</code>.</p>
  59. </div>
  60. <dl class="details">
  61. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="SpriteNodeMaterial.html#alphaToCoverage">SpriteNodeMaterial#alphaToCoverage</a></dt>
  62. </dl>
  63. </div>
  64. <div class="member">
  65. <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>
  66. <div class="description">
  67. <p>This flag can be used for type testing.</p>
  68. <p>Default is <code>true</code>.</p>
  69. </div>
  70. </div>
  71. <div class="member">
  72. <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>
  73. <div class="description">
  74. <p>This node property provides an additional way to set the point size.</p>
  75. <p>Note that WebGPU only supports point primitives with 1 pixel size. Consequently,
  76. this node has no effect when the material is used with <a href="Points.html">Points</a> and a WebGPU
  77. backend. If an application wants to render points with a size larger than 1 pixel,
  78. the material should be used with <a href="Sprite.html">Sprite</a> and instancing.</p>
  79. <p>Default is <code>null</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/materials/nodes/PointsNodeMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/nodes/PointsNodeMaterial.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号