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

Invalid texture data with deactivated mipmaps #88

Closed
stlemme opened this issue Jan 9, 2015 · 1 comment
Closed

Invalid texture data with deactivated mipmaps #88

stlemme opened this issue Jan 9, 2015 · 1 comment
Milestone

Comments

@stlemme
Copy link
Contributor

stlemme commented Jan 9, 2015

Using the texture filter combination (linear/linear)

<texture name="arvideo" filterMin="linear" filterMag="linear">
    <video autoplay="true" id="inputvideo" src="resources/my-video.mp4"></video>
</texture>

as shader input in conjunction with the usage of an Xflow operator results in an

Error: WebGL: texImage2D: invalid typed array type for given texture data type

Instead of directly passed the HTMLElement to WebGL, an ImageData object is retrieved from an internal canvas to fetch a frame of the video stream. This call returns an Uint8ClampedArray, which in turn is not valid as argument to be given to texImage2D (requires Uint8Array).

@ksons ksons added this to the Release 4.9 milestone Feb 3, 2015
@csvurt
Copy link
Contributor

csvurt commented Feb 16, 2015

Xflow uses Uint8ClampedArrays when web workers are involved, which is the right way to go about it I think. However WebGL doesn't accept these as data sources for tex2D, the suggested fix for this is to simply create a Uint8Array view on the underlying ArrayBuffer.

The above commit should cover all cases where a clamped array is used because the conversion is applied just before the data is sent to the gl context. With that I'll close this issue, if you still have this problem with the 4.9 release go ahead and reopen it.

@csvurt csvurt closed this as completed Feb 16, 2015
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

3 participants