You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
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 61 and 62 from build/depthkit.js, which contain the contents of the shaders, and replace lines 29 and 30 in src/depthkit.js. Then run npm i glslify and uncomment line 15 to make sure Three is referenced in depthkit.js.
I am trying to get the Depthkit.js player to work as a module for me also. I have followed your above instructions, but running into an error with the line const glsl = require('glslify'); - the error being:
Uncaught ReferenceError: require is not defined at depthkit.js:18 (anonymous) @ depthkit.js:18
I was wondering if you have experienced the same problem or have a potential solution?
I tried replacing const glsl = require('glslify'); with
import glslify from 'glslify';
// bundling of GLSL code
//const glsl = require('glslify');
const glsl = glslify;
Now I get the error: Error: It appears that you're using glslify in browserify without its transform applied. Make sure that you've set up glslify as a source transform:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Using:
How do I properly import this as a module?
The text was updated successfully, but these errors were encountered: