Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

texture with readImage vs texture with sprite

edited February 2013 in General Posts: 4

I have come to notice this discrepancy in image reading order when using texture with readImage vs texture with sprite in a mesh.

For some odd reason if you use for instance

mesh.texture = readImage("Documents:Imagename")

then Documents:Imagename will be read in upside-down and possibly flipped where as if you were to use

mesh.texture = sprite("Documents:Imagename")

then Documents:Imagename will be read in rightside-up.

The weird part is they both are pulling from the same source but the order the pixels are read in is not the same or atleast it doesnt seem that way.


  • SimeonSimeon Admin Mod
    Posts: 5,714

    This is fixed in 1.5.1.

    The discrepancy comes from the iOS image loader, which loads textures upside down. In previous versions of Codea this was never an issue as you weren't exposed to texture coordinates in shaders. We handled the flipping internally based on the type of image you were using ("Sprite:Key" vs. Codea image).

    In 1.5.1 we transform all images loaded through the iOS image loader so that everything is uniform. You might need to adjust your shaders when it's released.

Sign In or Register to comment.