PointsNodeMaterial.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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"><code>parameters</code></td>
  44. <td class="description last"><p>The configuration parameter.</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="alphaToCoverage" translate="no">.<a href="#alphaToCoverage">alphaToCoverage</a><span class="type-signature"> : boolean</span> </h3>
  53. <div class="description">
  54. <p>Whether alpha to coverage should be used or not.<br/>Default is <code>true</code>.</p>
  55. </div>
  56. <dl class="details">
  57. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="SpriteNodeMaterial.html#alphaToCoverage">SpriteNodeMaterial#alphaToCoverage</a></dt>
  58. </dl>
  59. </div>
  60. <div class="member">
  61. <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>
  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="sizeNode" translate="no">.<a href="#sizeNode">sizeNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec2></span> </h3>
  68. <div class="description">
  69. <p>This node property provides an additional way to set the point size.</p>
  70. <p>Note that WebGPU only supports point primitives with 1 pixel size. Consequently,
  71. this node has no effect when the material is used with <a href="Points.html">Points</a> and a WebGPU
  72. backend. If an application wants to render points with a size larger than 1 pixel,
  73. the material should be used with <a href="Sprite.html">Sprite</a> and instancing.<br/>Default is <code>null</code>.</p>
  74. </div>
  75. </div>
  76. <h2 class="subsection-title">Source</h2>
  77. <p>
  78. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/nodes/PointsNodeMaterial.js" target="_blank" rel="noopener" translate="no">src/materials/nodes/PointsNodeMaterial.js</a>
  79. </p>
  80. </article>
  81. </section>
  82. <script src="../scripts/linenumber.js"></script>
  83. <script src="../scripts/page.js"></script>
  84. </body>
  85. </html>
粤ICP备19079148号