Skip to content
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

getArrayData doesn't support Arrays, breaks three js support #56

Open
mhirsch opened this issue May 31, 2017 · 3 comments
Open

getArrayData doesn't support Arrays, breaks three js support #56

mhirsch opened this issue May 31, 2017 · 3 comments

Comments

@mhirsch
Copy link

mhirsch commented May 31, 2017

In three.js if you use MeshStandardMaterial, the code path eventually calls gl.uniform3fv with an array argument. This hits webgl.cc line 49 which looks like

  if(!arg->IsNull()) {
    if(arg->IsArray()) {
      Nan::ThrowError("Not support array type");
      /*
      Local<Array> arr = Local<Array>::Cast(arg);
      if(num) *num=arr->Length();
      data = reinterpret_cast<Type*>(arr->GetIndexedPropertiesExternalArrayData());*/
    }

I see that GetIndexedPropertiesExternalArrayData is now deprecated in node. I found this comment by @mikeseven in the node repo: nodejs/node#2977 (comment)

I assume this is the problem now? In this case is it a big deal to make a copy of the buffer? Is there a good reason this was never replaced with the new API mentioned in that node issue?

@mikeseven
Copy link
Owner

mikeseven commented May 31, 2017 via email

@mhirsch
Copy link
Author

mhirsch commented Jun 1, 2017

That would be really awesome! I'd love to have a way to access a standard OpenGL context through javascript + three.js, and your project looks like a great way to do it.

@mikeseven
Copy link
Owner

mikeseven commented Jun 1, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants