-
Notifications
You must be signed in to change notification settings - Fork 234
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
pythreejs Low Level Modifications (e.g. add threeJS Spot_Light) #276
Comments
Hi Timo, I think we have to change the shaders to take into account the pythreejs lighting. That involves diving into threejs, I am happy to assist you with the ipyvolume side of things. cheers, Maarten |
Greetings @maartenbreddels ! We are working on adding Lighting(Ambiental, Directional, Spot, Point, Hemisphere) support for ipyvolume rendering. Similar to pylab functions like plot_mesh, we are adding functions for every light type(exp addDirectionalLight()), each with specific parameters (some being adjsutable through sliders and color pickers). Our current shader tests feature vertex and fragment code from three.js(Lambert, Phong, Physical), combined with existing ipyvolume shader code, in order to be up to the visual standard from three.js examples. What is your opinion regarding the plan above? Please, if you have time, can you give any feedback in order for us to better prepare for the eventual Pull Request? |
We are concentrating on this until the end of March 2020. So we would appreciate any feedback as soon as possible. Thank you! |
That is awesome to hear. I think no widgets should be required, I think we should try to build as much as possible on top of pythreejs. What do think about that? |
Thank you for your answer! |
Indeed, I thought a bit about this, and I think ipyvolume can use for instance: I did the same with the Camera class/widget. It should also be possible to rely on the shader snippets from pythreejs. I think it does not require a lot of coding, but a lot of sorting out how threejs works. But I think it will pay of in not having to make a lot of new widgets, and possibly have more integrations with other threejs based projects. |
I'm really grateful for your prompt answers! def addAmbientLight(color=default_color): This does not give the desired result - no light added. |
@maartenbreddels Please excuse the long list of questions. Let me reduce them to just one: |
No, there is no scene in the python side, it is not exposed, it's only on the js side. |
Thank you :) |
Ok, there is actually! |
Yes :) |
Whow, I'm impressed! :) |
Thank you! We will open a PR as soon as possible! |
Hi, the PR will be handled from our official HRI-EU github account (https://github.com/HRI-EU). The first implementations of light support should be finished tomorrow. |
Hi, here is some feedback from @rinftech-github regarding the issues remaining with the scatter plot type: Regarding the shadow mapping issue with instanced geometry, this was discovered in three.js back in 2018: After some back and forth the maintainer implemented a fix in September 2019 which looks like it was included in release 109 as seen here: To benefit from it we would need pyhtreejs to be updated to at least three.js 109; We opened an issue on their github for that: I tried to assess what it would look like for us to make the change and it is not something to be done in a day or two, it would be so much more efficient for the maintainer to do the update. Attached is a screenshot with the shadow mapping issue – you can clearly see that the map only features one cube shadow. Maybe we will tackle this the next weeks. |
m using your library extensively for the plotting of 3D objects (meshes and voxel models).
Unfortunately, the lightning is quite simple and it is hard to infer the shape from some angles.
I'd like to add additional light sources and activate shadows, which seems to be possible from the pythreejs side.
So far I have not been successful is doing so. It is quite hard to figure out what I have to edit/add ... in the respective scenes/meshes/ ... which are stored in a figure.widgets container.
Could someone give some hints on how to achieve "adding and modifying lightning for ipyvolume plot?
Maybe an low level modification guide in the docs would be nice.
Thanks
The text was updated successfully, but these errors were encountered: