Vtk-js: Actor's property: LineWidth

Created on 29 Mar 2018  路  10Comments  路  Source: Kitware/vtk-js

In COre/Property, there's an attribute LineWidth but when I tried to change it, it doesn't change the display.
Does it really use for the rendering ?

bug 馃悶 feature request 馃挕

All 10 comments

It is but I think only Firefox support it for WebGL. You can find a blog post from Aashish on that topic for GeoJS.

webGL and webgl2 do not support line width:

https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/lineWidth

The webgl spec, based on the OpenGL ES 2.0/3.0 specs points out that the minimum and maximum width for a line is implementation defined. The maximum minimum width is allowed to be 1.0. The minimum maximum width is also allowed to be 1.0. Because of these implementation defined limits it is not recommended to use line widths other than 1.0 since there is no guarantee any user's browser will display any other width.

As of January 2017 most implementations of WebGL only support a minimum of 1 and a maximum of 1 as the technology they are based on has these same limits.

We should remove that API, was propably imported from vtk c++ without being tested.

Drawing triangles would be an option: https://mattdesl.svbtle.com/drawing-lines-is-hard

cc: @martinken

We kept the attribute in C++ and use triangles as needed. We can do the same for Webgl2 should a customer want it.

Thanks for these informations. Indeed, a customer wants it. It would be greate if anyone has some time to work on it or I will take a look when I have more time.
Thanks.

Did anyone have some time to look at it ?

No customer pull yet

definitely interested in line width drawing for 2d widgets on the 3d view.

Can we cheat and draw directly to the canvas instead, or would that be bypassing most of the VTK architecture?

Hi there @martinken @jourdain,
We'd also be interested in seeing this implemented. Have you by chance started working on it?

linewidth is difficult to implement properly so not super high on the list.

But it is very easy to implement poorly so that could be done very quickly. Just make the call to gl.lineWidth(width) in the mapper. Trick is hardware is not required to support anything other than a width of 1.0 so on some systems it will work, on others it will not.

linewidth is difficult to implement properly so not super high on the list.

But it is very easy to implement poorly so that could be done very quickly. Just make the call to gl.lineWidth(width) in the mapper. Trick is hardware is not required to support anything other than a width of 1.0 so on some systems it will work, on others it will not.

Also looking for adjusting lineWidth's. @martinken can you be more specific how your workaround shall be used with vtk.js?

... because I tried mapper.gl.lineWidth(width) mapper.lineWidth(width) but this did not work for me. I am by the way a complete beginner in js and vtk.js

Was this page helpful?
0 / 5 - 0 ratings