Skip to content

Line2NodeMaterial: Remove unused lineWidth property. #31401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 13, 2025

Conversation

Jenychen1996
Copy link
Contributor

@Jenychen1996 Jenychen1996 commented Jul 13, 2025

Fixed #31398

Description

In the global environment of three.js, the lineWidth in Line2NodeMaterial does not take effect and is essentially ineffective. To modify the line width, it is necessary to use the linewidth setting. Additionally, neither Material nor NodeMaterial contains a linewidth property. Therefore, the lineWidth property in Line2NodeMaterial should be changed to linewidth, and its default value should be set to 1.

In the global environment of three.js, the `lineWidth` in `Line2NodeMaterial` does not take effect and is essentially ineffective. To modify the line width, it is necessary to use the `linewidth` setting. Additionally, neither `Material` nor `NodeMaterial` contains a `linewidth` property. Therefore, the `lineWidth` property in `Line2NodeMaterial` should be changed to `linewidth`, and its default value should be set to 1.
Copy link

github-actions bot commented Jul 13, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.27
78.93
338.27
78.93
+0 B
+0 B
WebGPU 558.54
154.59
558.52
154.58
-17 B
-5 B
WebGPU Nodes 557.46
154.37
557.45
154.37
-17 B
-5 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.62
113.66
469.62
113.66
+0 B
+0 B
WebGPU 634.18
171.62
634.18
171.62
+0 B
+0 B
WebGPU Nodes 589.31
160.95
589.31
160.95
+0 B
+0 B

@Jenychen1996
Copy link
Contributor Author

Sry. I am unable to fix the ESLint check errors. When I try to modify WebGLRenderer.js, I am prompted that the current file cannot be edited.

@WestLangley
Copy link
Collaborator

Don't worry. The linting errors in WebGLRenderer.js have been fixed. You can try merging from dev again.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 13, 2025

Additionally, neither Material nor NodeMaterial contains a linewidth property.

The property is defined by the this.setDefaultValues( _defaultValues ); call in the constructor. So the property technically exists and does not have to be defined again.

Granted, this isn't ideal for documentation since Line2NodeMaterial derives from NodeMaterial and not a line material. However, for the time being, let's continue using the policy. So you can just remove lineWidth and that's it.

delete `linewidth` property.
@Mugen87 Mugen87 added this to the r179 milestone Jul 13, 2025
@Mugen87 Mugen87 changed the title Update Line2NodeMaterial.js Line2NodeMaterial: Remove unused lineWidth property. Jul 13, 2025
@Jenychen1996 Jenychen1996 requested a review from Mugen87 July 13, 2025 08:28
@Mugen87 Mugen87 merged commit de413e2 into mrdoob:dev Jul 13, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants