Skip to content

Examples: Improve webgpu_lines_fat.html#33498

Open
WestLangley wants to merge 2 commits intomrdoob:devfrom
WestLangley:dev-webgpu_lines_fat
Open

Examples: Improve webgpu_lines_fat.html#33498
WestLangley wants to merge 2 commits intomrdoob:devfrom
WestLangley:dev-webgpu_lines_fat

Conversation

@WestLangley
Copy link
Copy Markdown
Collaborator

Look at the current example and toggle on "world-units" and "dashed".

Current example: https://threejs.org/examples/webgpu_lines_fat.html

This PR modifies the GUI to ensure the parameters are reasonable.

Updated example: https://raw.githack.com/westlangley/three.js/dev-webgpu_lines_fat/examples/webgpu_lines_fat.html

//

Also, although the existing example looks pretty, the line segments are too short relative to the end-caps, so the example is not typical. This PR fixes that, too.

If approved, the related examples can be updated in a similar fashion.

@WestLangley
Copy link
Copy Markdown
Collaborator Author

@gkjohnson Are the artifacts still prominent?

@gkjohnson
Copy link
Copy Markdown
Collaborator

@gkjohnson Are the #33437 (comment) still prominent?

Yes the artifacts re still present on my machine. You can see them by setting the CSS background to white and enabling a2c.

image

--

Regarding the example, I find the curved lines to be much more appealing to look at, though I understand the dashed lines don't look great.

I also want to make sure that this is a separate effort from and not blocking those being discussed in #33437, #33457, and #33369, which are ready to be either merged or closed.

@WestLangley
Copy link
Copy Markdown
Collaborator Author

I also want to make sure that this is a separate effort from and not blocking those being discussed in #33437, #33457, and #33369.

Yes, this PR is separate from, and unrelated to, those efforts.

@WestLangley WestLangley added this to the r185 milestone Apr 30, 2026
@WestLangley WestLangley marked this pull request as ready for review April 30, 2026 01:05
@Mugen87
Copy link
Copy Markdown
Collaborator

Mugen87 commented May 3, 2026

Regarding the example, I find the curved lines to be much more appealing to look at,

I agree. Can you make the GUI updates without changing the visual aspects of the demo?

@WestLangley
Copy link
Copy Markdown
Collaborator Author

Can you make the GUI updates without changing the visual aspects of the demo?

I can, but the dashes look horrible...

Screenshot 2026-05-03 at 2 55 47 PM

Note that the GUI keeps the line width narrower than before, so the rendering will be different in any event.

The dashes do not work well on curvy lines.

@Mugen87
Copy link
Copy Markdown
Collaborator

Mugen87 commented May 3, 2026

The dashes do not work well on curvy lines.

If the dashes do not work well on curvy lines we should either remove the feature or fix it. We don't know how the users generates lines and if we provide a dashed style it should work with any curvature.

@WestLangley
Copy link
Copy Markdown
Collaborator Author

If the dashes do not work well on curvy lines we should either remove the feature or fix it.

Well, removing support for dashes is an option. (Follow the instructions in the first line of the original post in this thread as see how horrible it is.)

Users will likely not be happy with the removed feature, as there are uses cases where the dashes look OK -- such as the use case in this PR.

@gkjohnson
Copy link
Copy Markdown
Collaborator

I don't think every feature option needs to be perfectly and universally supported among all option combinations. I also don't think we need to "hide" these kinds of functional deficiencies in the examples. Users can determine whether the effect is suitable for their use case for themselves and the example makes the limitations apparent. Though I do think it would be an improvement to reduce the default "world units" width to fit the scale of the scene better, as has been done here.

--

In terms of improving the "dash" effect even with small segments: the dash end caps could be rounded just as the segment shapes are, which would hide the artifacts resulting from angles between the sections.

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.

3 participants