[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Issues with Animating textures in WebGL example on MDC



Your method signature for texImage2D is incorrect.  See below for the proper signatures. (https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/WebGL-spec.html)



texImage2D(GLenum target, GLint level, GLenum internalformat, 
                    GLsizei width, GLsizei height, GLint border, GLenum format, 
                    GLenum type, ArrayBufferView pixels);
    void texImage2D(GLenum target, GLint level, GLenum internalformat,
                    GLenum format, GLenum type, ImageData pixels);
    void texImage2D(GLenum target, GLint level, GLenum internalformat,
                    GLenum format, GLenum type, HTMLImageElement image);
    void texImage2D(GLenum target, GLint level, GLenum internalformat,
                    GLenum format, GLenum type, HTMLCanvasElement canvas);
    void texImage2D(GLenum target, GLint level, GLenum internalformat,
                    GLenum format, GLenum type, HTMLVideoElement video);
___________________________________
Michael Kelley
CTO
PixelActive Inc.


On Wed, Oct 13, 2010 at 2:13 PM, Nicolas Kassis <nic.kassis@gmail.com> wrote:
Hi,

I hope this is the right place to ask this.

I've been playing with the example on MDC that should show a rotating
cube with a video as textures. Example can be found here:
https://developer.mozilla.org/en/WebGL/Animating_textures_in_WebGL The
example is currently out of date and I updated it as much as I could,
my current version can be found here:
http://www.kassis.ca/webgl/video-sample

I changed all the references to WebGL*Array to their corresponding
typed array and added the precision stuff to the shader. I also had to
change line 60 because the "canplaythrough" event didn't seem to
occur.

Currently I'm stuck on line 287 of the webgl-demo.js file:

gl.texImage2D(gl.TEXTURE_2D, 0, videoElement, true);

This line throws TypeError in Chrome and n Mindfield I get:

uncaught exception: [Exception... "Not enough arguments"  nsresult:
"0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)"  location: "JS frame ::
http://kassis.ca/webgl/video-sample/webgl-demo.js :: updateTexture ::
line 287"  data: no]

Line 0

Thank you

--------
Nicolas Kassis
-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: