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

Re: [Public WebGL] Heads Up: WebGL API changes coming soon



----- Original Message -----
> == Obsolete TexImage2D API Removal ==
> 
> The second change is the removing of the now-obsolete form of
> texImage2D calls. The WebGL spec originally had a form of texImage2D
> that looked like this (for HTMLImageElement and other DOM elements):
> 
> texImage2D(target, level, HTMLImageElement, [optional] flipY,
> [optional] premultiplyAlpha)
> 
> This caused a number of problems once we looked at specifying what
> should happen when going from HTML image data to a texture given
> various source formats. The new form of this call looks like the
> standard buffer-taking texImage2D call:
> 
> texImage2D(target, level, internalformat, format, type,
> HTMLImageElement)

Also note that a similar API change applies to readPixels().

In the old API, readPixels() returns the buffer.

In the new API, readPixels() takes the buffer as argument.

Benoit



> 
> As described in the spec, the opaque image data provided by the DOM
> object will first be internally converted into the given format and
> type before being uploaded to GL. Additionally, two new PixelStore
> parameters replace the previous optional flipY and premultiplyAlpha
> parameters:
> 
> UNPACK_FLIP_Y_WEBGL
> UNPACK_PREMULTIPLY_ALPHA_WEBGL
> 
> More details on these can be found in the spec at
> https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/WebGL-spec.html#PIXEL_STORAGE_PARAMETERS
> .
> 
> Currently, all implementations support both the new form of this API
> call, as well as the old legacy form. You should be able to change to
> the new form of the calls and have content continue to work on recent
> nightly builds of any implementation, with the obsolete form slated
> for removal shortly.
> 
> We expect that enabling shader validation and removing the obsolete
> texImage2D calls will happen simultaneously, and within the next two
> weeks.
> 
> - Vlad
> -----------------------------------------------------------
> 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:
-----------------------------------------------------------
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: