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

Edge thickness/width #4791

Open
normanrz opened this issue Aug 28, 2020 · 5 comments
Open

Edge thickness/width #4791

normanrz opened this issue Aug 28, 2020 · 5 comments

Comments

@normanrz
Copy link
Member

This is an issue that we had for a long time: The edges between nodes are only 1 pixel wide. It would be great to be able to increase that for visibility. We know that on some platforms (Chrome on Windows, I believe) this is not possible due to limitations in WebGL. However, perhaps on other platforms this could still be a win for users.

@daniel-wer
Copy link
Member

So the status quo seems to be that the line width was deprecated and now stops to work on even more platforms (not only Windows) according to https://stackoverflow.com/a/41911520

In my case it is still working (Ubuntu 18.04, Chrome):

Peek 2020-09-07 19-07

I'll try to get something with THREE.MeshLine or https://threejs.org/examples/?q=line#webgl_lines_fat working, but it's slightly complicated as we're using shaders for our lines which don't seem to be supported on a first look. We'll also have to see whether there is a noticeable performance impact.

@daniel-wer
Copy link
Member

From what I've gathered and experimented with

  • THREE.MeshLine
    • uses own fragment/vertex shader with own MeshLineMaterial, so we cannot use our own line shader
    • doesn't support THREE.BufferGeometry which we use to manage edges and nodes
    • performance hit not clear
  • fat lines
    • uses own fragment/vertex shader with own LineMaterial, so we cannot use our own line shader
    • doesn't seem to support THREE.BufferGeometry, setPositions method needs to be called
    • from this example which someone posted in the fat lines PR, the performance hit seems to be pretty big (use space to toggle between the GL.Line and FatLine implementations)

Both materials seem to support a color, though and we should also be able to hide objects (which are the only two things we do in our custom line shader). I am unsure about the performance impact of not being able to use the BufferGeometry.

Using one of these replacements, performance is only going to become worse for tracings with a large amount of trees. We should discuss this step carefully.

@normanrz normanrz reopened this Aug 8, 2022
@philippotto
Copy link
Member

@philippotto
Copy link
Member

In todays meeting @normanrz suggested to gather more performance insights for this feature first (i.e., what will the concrete performance hit be).

from this example which someone posted in the fat lines PR, the performance hit seems to be pretty big (use space to toggle between the GL.Line and FatLine implementations)

On my machine the hit is at least a factor of 3 (without fat lines the FPS meter is consistently at 60 which is obviously capped; with fat lines it's more at 20). So, this option is probably not a good idea.

Therefore, I'd suggest to make a similar benchmark for THREE.MeshLine.

THREE.MeshLine [...] doesn't support THREE.BufferGeometry which we use to manage edges and nodes

The current readme mentions BufferGeometries now. See here. Hopefully, this support is exactly what we need.

Another note on performance:
If it's not a big effort, we could make the fat line rendering optional. Then, users who need the extra drop of performance (OR whose GPU supports native line width) can disable the potentially expensive rendering.

@philippotto
Copy link
Member

See spite/THREE.MeshLine#140 (comment) for maintenance status of the lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants