-
Notifications
You must be signed in to change notification settings - Fork 145
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
parameter 'pixels' of TexImage2DAsync can't be deserialization to ArrayBufferView #65
Comments
TFeast's solution didn't work for me... so: As we know, inputting bytes in texImage2D's last parameter throws an error, but ints work. I also noticed that Uint8Array.from(object) (which allows for bigger filesizes than .as) didn't like being sent ints to be converted into bytes. So I did this work around: Encode your image data's RGBA into an uint array in c#:
Then decode it in typescript by putting this else before the one looking for !method.endsWidth("v"):
Obviously this is just a quick hack, RGBA becomes a requirement and it's going to be slow. |
I get a similar exception when loading a texture from an array. I am trying a port of the official sample (https://github.com/mdn/webgl-examples/blob/gh-pages/tutorial/sample6/webgl-demo.js#L200) to Blazor but this seems currently not working. Any chance this will get fixed soon? At least the OpenGL samples should work out of the box to be useful.
|
I'm add a parameter for TexImage2DAsync() and test,It's throw a error :
"Failed to execute 'texImage2D' on 'WebGLRenderingContext': parameter 9 is not of type 'ArrayBufferView'"
then call JSRuntime wraps data to Uint8Array,I can render the texture
The text was updated successfully, but these errors were encountered: