Closed cmbruns closed 4 years ago
This would be more than welcome, or at least document that it is not supported. Too many hours wasted porting volume rendering code to pythreejs, only to find out that it won't be possible...
Hmm, yes, Id like ipyvolume to also be more pythreejs oriented, and I think I want to switch to webgl too.
We could also consider to switch to using webgl2 by default (if it is available), i.e. that the trait on Renderer
defaults to True
.
I made a draft PR here: https://github.com/jupyter-widgets/pythreejs/pull/289
I basically just wrote out what the guide said would be needed, but haven't had the chance to test it at all. If someone could help verify (or spot issues), that would help this along greatly!
@vidartf Thanks for a quick fix. So far I can confirm that the mode works with your PR, although I am still having texture trouble (DataTexture3D misbehaving with the built-in preview, and not even 2d textures working in my ShaderMaterial -- the latter probably due to bugs in my code). I'll get back to this tomorrow.
The previewer is trying to be smart, but is meant mostly for simple constructs. Let me know how it goes :)
There is something weird going on even with 2d textures, that I cannot quite understand. Here is a minimal test: https://zi.fi/WebGL2-ShaderMaterial.ipynb WebGL2-ShaderMaterial.pdf
EDIT: I just confirmed that the texture problem occurs with webgl_version=1
too, so it is not relevant to this issue.
I just confirmed that the texture problem occurs with webgl_version=1 too, so it is not relevant to this issue.
Ok, please open a separate issue for this if you cannot figure it out :)
WebGL version 2 provides more advance rendering options compared to WebGL version 1. Only for those browsers that support it of course.
Maybe the syntax could be something like
Three.js is gradually enhancing its support for webgl2: https://threejs.org/docs/#manual/en/introduction/How-to-use-WebGL2