pythreejs icon indicating copy to clipboard operation
pythreejs copied to clipboard

Updating three.js to be able to use InstancedMesh(and shadow maps with instanced geometry)

Open crazyquark opened this issue 5 years ago • 8 comments

Hello,

Our project needs to use InstancedMesh, introduced here: https://github.com/mrdoob/three.js/pull/17505 (I think in r109)

Would it be possible to update pythree to at least three.js 109?

We want to implement shadow mapping in ipyvolume, unfortunately we need a feature that was introduced in three.js 109 for shadow maps to work properly with instanced geometry, I am referring to this issue: https://github.com/mrdoob/three.js/issues/13995

This is was addressed with the PR mentioned above: https://github.com/mrdoob/three.js/pull/17505

crazyquark avatar Mar 31 '20 13:03 crazyquark

Would it be possible to update pythree to at least three.js 109?

Yes, that should be possible (we would probably update to latest release then), I just need to find some spare time. If you want to help out push this along, please let me know and I can outline the steps needed to upgrade, and you can get started :)

vidartf avatar Apr 03 '20 10:04 vidartf

@vidartf Hi, yes, indeed, can you outline the process? Maybe I can help(I am comfortable with both python and JS)

crazyquark avatar May 05 '20 11:05 crazyquark

The main workload is probably to go through all the changelogs and identify any changes to the properties and/or constructor signatures of existing objects. Additionally, any newly added objects should be added to the spec.

The spec to update is here: https://github.com/jupyter-widgets/pythreejs/blob/master/js/scripts/three-class-config.js

Once a first attempt has been made on the spec, get the JS dev env set up (clone + npm install in js folder), and run npm run autogen:enum[s] and npm run autogen to look for any obvious complaints.

If you get this far, that would be very helpful :)

Note that since the API docs of threejs has become much more reliable, it might be possible to streamline this process by using a script to extract (parts of) the config from the API docs. I'll leave it up to you to decide which seems faster / more fun?

vidartf avatar May 05 '20 14:05 vidartf

@vidartf Hi. So I've been trying to update three.js(got to version r103) but now I am having trouble testing it against ipyvolume, I made a virtualenv w/ python3 where I installed the dev pythree but when I run jupyter-notebook it still picks up three.js 97(as far as I can tell). Could you maybe give me a short testing scenario for pythree and ipyvolume? My current work is here: https://github.com/crazyquark/pythreejs/tree/feature/updateThree

crazyquark avatar May 13 '20 14:05 crazyquark

I had to manually run: jupyter nbextension uninstall jupyter-threejs for it to pickup the updated pythree ... no sure why?

crazyquark avatar May 13 '20 15:05 crazyquark

I've not worked much with ipyvolume, so I won't be able to help you with that, sorry. Maybe @maartenbreddels has some input?

vidartf avatar May 14 '20 13:05 vidartf

jupyter nbextension uninstall jupyter-threejs for it to pickup the updated pythree

You either need to symlink it (jupyter nbextension --symlink ...) or you will need to uninstall/reinstall every time it changes.

vidartf avatar May 14 '20 13:05 vidartf

I would like to use this feature too. This would unlock large scenes, moreover I've been spending some time trying to workaround current limitations using current api, failing hard on every possible way.

arkanoid87 avatar Aug 26 '20 16:08 arkanoid87