Kitware / vtk-js

Visualization Toolkit for the Web
https://kitware.github.io/vtk-js/
BSD 3-Clause "New" or "Revised" License
1.24k stars 378 forks source link

Volume rendering issue with Safari #1534

Closed jcbuisson closed 4 years ago

jcbuisson commented 4 years ago

Hi there,

I build a 3D viewer for CT-scan images. Everything works fine with Chrome (83) and Firefox (78), but on Safari (13) the image appears shredded: the main volumes are there, but locally everything is messed up

Here is a CodeSandbox which illustrates this problem (it downloads a 240Mo CT-scan .vti file, you may need to be patient)

https://codesandbox.io/s/vtkjs-volume-rendering-i5vxz

Any idea?

Capture d’écran 2020-07-16 à 10 31 52 Capture d’écran 2020-07-16 à 10 35 51
floryst commented 4 years ago

My first guess is this may be a webgl vs webgl2 issue? Safari 13 doesn't enable webgl2 by default. If you enable webgl2 under Safari's "experimental features" in the developer menu, will that fix the rendering?

jcbuisson commented 4 years ago

No, I activated "Experimental features -> WebGL 2.0" and now there is no image at all, and the JS console if full of errors : "WebGL: INVALID_ENUM: texParameter: invalid parameter name" in front of instruction "renderWindow.render()"

floryst commented 4 years ago

@martinken Can you take a look? I don't have macOS for testing.

jcbuisson commented 4 years ago

There is nothing to show, the image is empty, probably because of the failure of renderWindow.render()

martinken commented 4 years ago

Does it fail on 13.10.0 ?

martinken commented 4 years ago

Without the experimental WebGL2

jcbuisson commented 4 years ago

I'll tell you as soon as my system upgrade is over (it seems to be the only way to get the last version of Safari)

jcbuisson commented 4 years ago

I updated MacOS & Safari to their latest versions, but the situation is the same: a shredded image by default, and no image at all with lots of errors "WebGL: INVALID_ENUM: texParameter: invalid parameter name" when I activate the (experimental) feature "WebGL2" Here is a sandbox which illustrates the problem: https://codesandbox.io/s/vtkjs-volume-rendering-i5vxz

vtk.js with its companion library itk.js are more and more used to visualize medical imagery, and the medical world uses a lot MacOS and Safari

martinken commented 4 years ago

Did you also test it with the Webgl2 off?

jcbuisson commented 4 years ago

Yes, it gives a shredded image (but no errors in console)

martinken commented 4 years ago

Thanks, should be fixed in master now.