-
Notifications
You must be signed in to change notification settings - Fork 169
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
texImage2D is not working. #149
Comments
See this comment. The last link should lead you to an example snippet |
Looks like @Divy123 had opened a similar issue. |
@dhritzkiv I did try the exact same code but for some reason that seems to not work for us, the output is always a black image. |
Please have a look at this block of code https://github.com/publiclab/image-sequencer/pull/964/files#diff-0ed30b2ef28487bbffa9087b7aab8ea5R193 |
Jywarren had linked to this diff https://github.com/stackgl/headless-gl/pull/53/files#diff-c24e210c8552e30550810a8b75aa1cdaR101 It seems like this diff is in a pr which isn't merged yet. |
A few things to try:
|
@harshkhandeparkar Ahh, good catch. Still, I believe |
@dhritzkiv Thanks a lot! I'll try this out and circle back here! :) |
Is the latest version pushed to npm? |
master branch is what's on npm right now |
Okay I don't think ArrayBuffer data type is supported here |
btw I am using a macbook pro on macOS Mojave, could this be a platform issue? |
Does it have a proper gpu? Not in-built? |
Nope, it uses Intel Integrated graphics. |
Maybe it doesn't have proper dependencies installed for inbuilt gpu? |
Each vendor uses their own version of computing languages |
OK, well in that case I'll this on a windows machine with a gpu. |
Well the documentation does say there are no extra dependencies for macOS though. |
The MacBook should be fine. The graphics layer on macOS is pretty stable and consistent. Regarding ArrayBuffer not working, you should use the specific data type |
Maybe the node-gyp docs will help? |
@tech4GT Oops, One more step before running npm install locally: run |
aha! One test is failing now @dhritzkiv |
Interesting. That sort of failure (no plan found) isn't indicative of a failure of the suite, but more of the test framework. It varies by machine. Unfortunately, I don't have a fix. Sometimes running it multiple times fixes it. It actually seems as though some |
No, actually none of they say texImage2d. :/ |
Can you post a bigger screenshot? |
@dhritzkiv also can you suggest a good way to capture image data out of texture? |
This is how I've gotten the image data out of the gl context (not quite the same, but might give you a place to start: // render a scene or a texture
const pixels = new Uint8Array(4 * width * height);
gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
const buffer = Buffer.from(pixels.buffer);
await sharp(buffer, {
raw: {
width,
height,
channels: 4
}
})
.flip()
.png()
.toFile(outputFileName); Notes:
Sorry I can't be of more help -- I haven't done this stuff in a while and am quite rusty. |
Can we get the data back as a buffer or a data-uri or a pixels array? |
Public Lab swarm! 😄 🙌 Thank you @dhritzkiv for being SO helpful! We really appreciate it! @harshkhandeparkar would we just be able to read directly from |
As an aside, this works fine in GPU.js. |
So, do we know what is the status on this ? I have the exact same issue as OP, texture does not show up. Running on a macbook pro as well. |
We have been trying to use headless-gl for some gl-based server side image processing here
publiclab/image-sequencer#964
, but the recommended way of uploading an Image into the texture is not working for us.
We could really use some guidance and possibly an example usage of a function.
Also it would be nice if someone can point us to the exact part of the code where the parameters are being consumed.
Thanks :)
The text was updated successfully, but these errors were encountered: