[Public WebGL] y-orientation for texImage2D from HTML elements

Jeff Gilbert [email protected]
Fri Dec 7 17:00:50 PST 2012

The current wording is insufficient:
"If set, then during any subsequent calls to texImage2D or texSubImage2D, the source data is flipped along the vertical axis, so that conceptually the last row is the first one transferred."

This refers to the 'first' and 'last' without clearly specifying which row we upload first for HTML elements. At minimum, we need to specify that we (by default) upload HTML elements to TexImage2D starting with their top row. For the purposes of OpenGL, 'first row' almost always means bottom row. Since this is not the convention we use for HTML elements, it must be spelled out. This should be specified in our spec for texImage, not buried in the spec for UNPACK_Y_FLIP. No modification needs to be made to UNPACK_Y_FLIP's definition, as long as we *do* specify the order of rows for texImage uploads for HTML elements.

As it stands today, I fully believe that the row order of texImage2D HTML element uploads is undefined in the spec, leaving its behavior up to the implementations.

----- Original Message -----
From: "Kenneth Russell" <[email protected]>
To: "Mark Callow" <[email protected]>
Cc: "Jeff Gilbert" <[email protected]>, "Gregg Tavares (社用)" <[email protected]>, "public webgl" <[email protected]>
Sent: Thursday, December 6, 2012 8:33:51 PM
Subject: Re: [Public WebGL] y-orientation for texImage2D from HTML elements

On Thu, Dec 6, 2012 at 7:32 PM, Mark Callow <[email protected]> wrote:
> On 2012/12/07 12:07, Jeff Gilbert wrote:
> At the absolute minimum, we need wording in the spec that spells this out:
> "We send decoded image data top-row-first into texImage2D, which, per spec,
> expects bottom-row-first data. This means that textures uploaded this way
> will be upside down compared to textures uploaded via other methods. You can
> force HTML element uploads to upload bottom-row-first by using
> UNPACK_FLIP_Y_WEBGL=true, but this also flips the order that TypedArray rows
> are uploaded."
> I have no objection to adding a note to the spec. I would prefer something
> along the lines of:
> The default texture coordinate system in OpenGL is such that the first row
> of data loaded by texImage2D will appear at bottom of the texture. However
> the first row of data in HTML elements is the logical top of the image
> therefore textures uploaded from HTML elements will appear upside down. One
> way of adjusting for this is to set UNPACK_FLIP_Y_WEBGL=true. Then
> texImage2D will flip the rows of data as it uploads them.
> UNPACK_FLIP_Y_WEBGL affects the operation of texImage2D for all data
> sources.

This seems like too much text to me.
already defines UNPACK_FLIP_Y_WEBGL very clearly. The only text that
should possibly be added in my opinion is a brief note in
http://www.khronos.org/registry/webgl/specs/latest/#5.14.8 under the
texImage2D and texSubImage2D overloads taking HTML elements and
ImageData, which already reference the above section. I'm still
unconvinced that changes are needed here so if someone could please
propose spec text in this context it would be helpful.


> Regards
>     -Mark
> --
> 注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合が有ります。正式なメール受信者では無い場合はメール複製、
> 再配信または情報の使用を固く禁じております。エラー、手違いでこのメールを受け取られましたら削除を行い配信者にご連絡をお願いいたし ます.
> NOTE: This electronic mail message may contain confidential and privileged
> information from HI Corporation. If you are not the intended recipient, any
> disclosure, photocopying, distribution or use of the contents of the
> received information is prohibited. If you have received this e-mail in
> error, please notify the sender immediately and permanently delete this
> message and all related copies.

You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl

More information about the public_webgl mailing list