ScatterCo / Depthkit.js-deprecated

🎞 A plugin for using Depthkit's volumteric captures in Three.js
https://depthkit.tv
MIT License
33 stars 11 forks source link

npm module usage not working #13

Open heaversm opened 4 years ago

heaversm commented 4 years ago

Do you happen to have a working example of importing depthkit via the npm module?

I'm not positive, but I believe that the npm module (which I believe is tied to this repo, not the fork, is not set up to export properly, which means that you cannot use three.js module imports - which is necessary for various functionalities within three.js (anything within the jsm folder, for example).

As such, the only luck I have in using depthkit.js is to do what has been done in the current examples folder - which is load a previous release of three.js via a <script> tag, followed by a script tag for depthkit, and forego any usage of es6 imports in my project.

wpreble1 commented 3 years ago

I had a similar issue with trying to use an ES6/webpack workflow. I was able to solve it by copying the contents of src/depthkit.js into my own repo. Then import directly from that file import DepthKit from './depthkit';. Then, copy lines 164 and 165 from build/depthkit.js, which contain the contents of the shaders, and replace lines 142 and 143 in src/depthkit.js. Then run npm i glslify.