three.js icon indicating copy to clipboard operation
three.js copied to clipboard

Nodes: InstancedPointsNodeMaterial - InstanceSize support

Open cmhhelgeson opened this issue 1 year ago • 2 comments

Description

Add the ability to apply a per instance size attribute to the InstancedPointsGeometry, and access that attribute within the InstancedPointsNodeMaterial. The existing approach is extended, specifying via parameters that the material should access the instanceSize attribute of the relevant geometry rather than the uniform width value passed directly to the material. However, we could modify the material down the line to use an approach more in line with existing node materials, where the output is modified by applying nodes to the material ( such as a positionNode or sizeNode ) rather than setting static parameters that determine the nodes the material creates internally.

https://github.com/user-attachments/assets/d722ea8d-294c-4c2d-aabb-35b2d7e1ed47

cmhhelgeson avatar Aug 27 '24 05:08 cmhhelgeson

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
685.4 kB (169.7 kB) 685.4 kB (169.7 kB) +0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
462 kB (111.4 kB) 462 kB (111.4 kB) +0 B

github-actions[bot] avatar Aug 27 '24 20:08 github-actions[bot]

The screenshot appears to be passing in local tests. I've tried passing in a new one, but Git keeps indicating that the new image cannot be pushed in, as it is the same as the current one.

EDIT: I think I will just add the example as an exception to puppeteer for now.

cmhhelgeson avatar Aug 27 '24 20:08 cmhhelgeson

Sometimes it is necessary to update the build to take the screenshot.

sunag avatar Aug 29 '24 04:08 sunag