BUG? vert flipping (copy of) rendered textures in windows

G’day

Have found an annoying bug that I can’t find any mention of so I would kindly ask if somebody can see if I’m doing anything wrong. I’m making a Texture2D from a camera by:

  • first make a new camera and clone the main camera’s settings
  • set rendertexture to a temp. texture
  • render
  • copy rendertexture to Texture2D using ReadPixels (setting RT active)

On Mac OS X the Texture2D is as you would expect, but on windows (tested on two systems and on mac with WINE) the Texture2D is vertically flipped.

Can anyone point out if I’m doing it wrong or if it is a bug (as I strongly suspect) if I can assume the texture will always be vertically flipped on windows (so I can hack around the problem)?

(in the project the Render Camera and Render Cube can easily be removed, was just a test if it was the RenderTexture or the copying where the flipping seems to occur).

Thanks!
Jaap

104030–3996–$fliptest_174.zip (4 MB)
104030–3997–$fliptest_src_590.zip (846 KB)

I have the same thing. I query the hardwarestring thingy you can get from unity, and see if it contains “OpenGL”. if it does, I vertically flip my rendertexture.

When this gets fixed, I’ll need to undo my workaround :slight_smile:

Bye, Lucas

It also does the vertical flip when using ReadPixels() with OS X dashboard widgets. So it’s not just an OpenGL vs. Direct3D thing.

–Eric

Thanks for your responses, at least I now know I can be certain it goes wrong on all windows platforms using DirectX (and with widgets? but that’s not a problem for me yet ;-).

Just a heads up: found the bug, will be fixed in next release of Unity (2.5).

Thank you!
(any word on when the release is expected? ;-))