Просмотр исходного кода

PointsNodeMaterial: Improve JSDoc. (#31703)

* PointsNodeMaterial: Improve JSDOc.

* PointsNodeMaterial: Improve JSDoc.
Michael Herzog 9 месяцев назад
Родитель
Сommit
ff863e6b6e
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      src/materials/nodes/PointsNodeMaterial.js

+ 16 - 0
src/materials/nodes/PointsNodeMaterial.js

@@ -15,6 +15,22 @@ const _size = /*@__PURE__*/ new Vector2();
 /**
  * Node material version of {@link PointsMaterial}.
  *
+ * This material can be used in two ways:
+ *
+ * - By rendering point primitives with {@link Points}. Since WebGPU only supports point primitives
+ * with a pixel size of `1`, it's not possible to define a size.
+ *
+ * ```js
+ * const pointCloud = new THREE.Points( geometry, new THREE.PointsNodeMaterial() );
+ * ```
+ *
+ * - By rendering point primitives with {@link Sprites}. In this case, size is honored,
+ * see {@link PointsNodeMaterial#sizeNode}.
+ *
+ * ```js
+ * const instancedPoints = new THREE.Sprite( new THREE.PointsNodeMaterial( { positionNode: instancedBufferAttribute( positionAttribute ) } ) );
+ * ```
+ *
  * @augments SpriteNodeMaterial
  */
 class PointsNodeMaterial extends SpriteNodeMaterial {

粤ICP备19079148号