Skip to content
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

sometimes lines are thin at certain angles (was face billboarding doesn't quite work) #5

Open
trusktr opened this issue Jan 16, 2023 · 1 comment

Comments

@trusktr
Copy link
Member

trusktr commented Jan 16, 2023

For example, here is a portion of the SVG demo with a line thickness greater than 1 and sizeAttenuation enabled, with the camera line of site perpendicular to direction of the lines (note the area in the red circle):

Screenshot 2023-01-16 at 3 31 55 PM

When we start to make the camera line of sight parallel with the map from down below, we can see the same area loses its thickness:

Screenshot 2023-01-16 at 3 36 44 PM

Here's a similar angle but from the side instead of below, and the line maintains its thickness:

Screenshot 2023-01-16 at 3 35 24 PM

@trusktr
Copy link
Member Author

trusktr commented Jan 20, 2023

The joint lines are billboarded, but the user lines are also approaching parallel with the direction of the joint line, so there's nothing that can be done with the current geometry.

To fix this, we need to take advantage of WebGL 2 geometry shading (generate the vertices in the shader, so that the only thing we need to pass in is the user line points), or WebGPU compute shading (similar, but different).

Ultimately the user will provide only a single array of line points, then shading handles the rest, which includes generating points or pixels around the user points to draw the region of the line, including joint miters, rounded corners, end caps, etc.

We will implement that in, #7, and that will close this issue.

@trusktr trusktr changed the title sometimes face billboarding doesn't quite work sometimes lines are thin at certain angles (was face billboarding doesn't quite work) Jan 20, 2023
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

No branches or pull requests

1 participant