Skip to content

Conversation

@RenaudRohlinger
Copy link
Collaborator

@RenaudRohlinger RenaudRohlinger commented Sep 25, 2024

Related issue: #29394 #29374

Description

Second attempt following #29374 to add support for sizeAttenuation in InstancedPointsNodeMaterial as a fallback for THREE.Points.

This contribution is funded by Segments.AI & Utsubo

@github-actions
Copy link

github-actions bot commented Sep 25, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 687.46
170.22
687.46
170.22
+0 B
+0 B
WebGPU 838.62
224.9
839.02
225.03
+404 B
+131 B
WebGPU Nodes 838.13
224.78
838.53
224.91
+404 B
+126 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 463.24
111.86
463.24
111.86
+0 B
+0 B
WebGPU 533.78
143.98
533.78
143.98
+0 B
+0 B
WebGPU Nodes 490.12
133.72
490.12
133.72
+0 B
+0 B

@sunag sunag added this to the r169 milestone Sep 25, 2024
@WestLangley
Copy link
Collaborator

Sprites have a map, are sized in world units, can be size-attenuated, and can be rotated.

Points are sized in pixels, and are just a "fat" point-list primitive.

It doesn't make sense to size-attenuate something sized in pixels.

@RenaudRohlinger
Copy link
Collaborator Author

Following numerous requests from developers, I'm attempting to offer a fallback solution to THREE.Points, as size attenuation on points larger than 1px is widely used especially since Points.sizeAttenuation is enabled by default.

While I understand that in certain cases, like InstancedPointsNodeMaterial, it may not seem logical to size-attenuate something rendered in pixels, the practical use of size attenuation remains prevalent across many projects.

If you strongly believe that size attenuation is unnecessary for InstancedPointsNodeMaterial, I'm open to creating a new class (e.g., PointsWebGPU) specifically to provide a fallback for THREE.Points in WebGPU. In that scenario, I also plan to rename pointWidth to size to facilitate a smoother transition from Points. Would this approach work for you?

@WestLangley
Copy link
Collaborator

Thank you for your reply.

I would be happy if:

  1. (Instanced) sprites could be sized in world units, and points sized in pixels.
  2. Size attenuation set to true by default for sprites, but it can be disabled.
  3. Points cannot be size-attenuated.

If that is not acceptable for some reason, then an alternative could be to allow points to be sized in either pixels or world units -- but I prefer the solution above.

JMHO, of course. If you disagree, I will not object. :-)

@RenaudRohlinger RenaudRohlinger marked this pull request as draft September 26, 2024 08:52
@mrdoob mrdoob modified the milestones: r169, r170 Sep 26, 2024
@mrdoob mrdoob modified the milestones: r170, r171 Oct 31, 2024
@mrdoob mrdoob modified the milestones: r171, r172 Nov 29, 2024
@mrdoob mrdoob modified the milestones: r172, r173 Dec 31, 2024
@mrdoob mrdoob modified the milestones: r173, r174 Jan 31, 2025
@mrdoob mrdoob modified the milestones: r174, r175 Feb 27, 2025
@mrdoob mrdoob modified the milestones: r175, r176 Mar 28, 2025
@mrdoob mrdoob modified the milestones: r176, r177 Apr 24, 2025
@mrdoob mrdoob modified the milestones: r177, r178 May 30, 2025
@mrdoob mrdoob modified the milestones: r178, r179 Jun 30, 2025
@mrdoob mrdoob modified the milestones: r179, r180 Aug 1, 2025
@mrdoob mrdoob modified the milestones: r180, r181 Sep 3, 2025
@mrdoob mrdoob modified the milestones: r181, r182 Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants