The WebKit flipY bug: fixed?

I’ve a favour to ask: if you’re running Mac OS X 10.6 (Snow Leopard) and have the very latest WebKit nightly build installed, could you check out this page with it and leave a comment here saying whether or not the texture is the right way up?

Here’s why: all of the tutorials on this site that use textures have a bit of hacky code in the fragment shaders that vertically flips the textures used. The textures need flipping because our texture coordinates, like the coordinates we use for positioning vertices, have values on the Y axis increasing as you move upwards, whereas the texture images we’re loading from image files follow the traditional computer graphics system of having the Y values increase as you move downwards. Of course, flipping the image by way of an extra operation in the fragment shader is inefficient, as it happens for every pixel on every redraw; it would be better to flip the image once, when it’s initially loaded. There is a way to do that; the texImage2D function we use to bind loaded images to textures has a flipY parameter for exactly that purpose. However, there was a bug in WebKit that meant that that parameter had no effect. This is now apparently fixed, so if a kindly Mac user can confirm to me that it is, I will go back through the lessons and remove the last remaining bit of compatibility cruft. Yay!

[UPDATE] Looks like it’s fixed — I’ve updated the lessons.

Thanks to Andy Jackson for the heads-up about this!

You can leave a response, or trackback from your own site.

4 Responses to “The WebKit flipY bug: fixed?”

  1. Brit says:

    Yes, when initially loading the page in the latest webkit nightly, the texture is in the correct orientation. I assume this is what you mean?
    http://drp.ly/ACyc1

  2. Same here, the texture orientation is correct.

    (6531.22.7, r55959)

  3. murphy says:

    Same here :)

  4. giles says:

    Brilliant, thanks guys! Time to get rid of the cruft in the fragment shaders, then.

Leave a Reply

Subscribe to RSS Feed Follow Learning WebGL on Twitter