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

Re: [Public WebGL] Adding internalformat param to all texImage2d variants



On Wed, May 12, 2010 at 11:55 AM, Cedric Vivier <cedricv@neonux.com> wrote:
> On Thu, May 13, 2010 at 02:08, Chris Marrin <cmarrin@apple.com> wrote:
>> I believe that covers all the cases. This assumes that all incoming grayscale images are converted to RGB and alpha is only present if it was in the original source image (which is never for JPG). I think this is the only way we can reasonably support the 1 and 2 channel formats for incoming images.
>>
>> Comments?
>
>
> I think all cases are handled... except the current case.
> When a developer does not care - or even know [1] - about the format
> for the given element, the helper should not perform undesirable
> conversion, including in the case of incoming grayscale image.
> This means we probably need to define eg. internalFormat=0 :
>
> internalformat/incoming data                    RGB
>       RGBA
> ------------------------------------        ------
>   --------
> 0                                                          no
> conversion                no conversion

Agreed, for convenience it should be possible to pass 0 for the internal format.

To be clear, is this the proposed new IDL?

    void texImage2D(GLenum target, GLint level, GLint internalformat,
ImageData pixels, optional GLboolean flipY, optional GLboolean
asPremultipliedAlpha) raises(DOMException);
    void texImage2D(GLenum target, GLint level, GLint internalformat,
HTMLImageElement image, optional GLboolean flipY, optional GLboolean
asPremultipliedAlpha) raises(DOMException);
    void texImage2D(GLenum target, GLint level, GLint internalformat,
HTMLCanvasElement canvas, optional GLboolean flipY, optional GLboolean
asPremultipliedAlpha) raises(DOMException);
    void texImage2D(GLenum target, GLint level, GLint internalformat,
HTMLVideoElement video, optional GLboolean flipY, optional GLboolean
asPremultipliedAlpha) raises(DOMException);

Vlad, if we make this spec change, how soon could Firefox implement
it? Unfortunately nearly all WebGL content is going to break with this
change. It'll be better if we upgrade all of the browsers at the same
time.

-Ken

> Regards,
>
> [1] : textures provided by user or loaded from a third-party source.
>
> -----------------------------------------------------------
> You are currently subscribe 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 subscribe to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: