I have been having issues 'building' a texture from several others. At first I thought I needed to 'blit' one texture upon the other, then I realized, I need to 'render' onto a texture.
So , I have my src textures, and I render them onto my destination texture, this works great, until I then try to use that destination texture, and its totally upside down, mirrored.
After some reading, it appears this is a common issue with rendering onto a texture.
I dont really feel like making a duplicate for all my text drawing, sprite drawing functions just to make them reverse the Y
So, my question is.... once I have my destination texture, is there an easy way to simply Flip the texture, so then when I do use it to render, it will be correct.
I was thinking... is it possible to render the texture onto itself?
such as, if I have my dst texture as my render target, can I simply render it to itself, on a quad with an inverted texture Y coord?
Thanks for any advice.
Flip (Mirror Vertical) a texture
Started by SelethD, Nov 14 2012 09:21 PM
3 replies to this topic
Sponsor:
#2 Members - Reputation: 246
Posted 14 November 2012 - 10:14 PM
Ok, I have tried to render a quad textured with the 'render target' texture, onto itself, and this works.
However, i cant figure out to flip it vertically, I tried to swap the UV for the Y portion (cant remember if the Y is the U or the V) when drawing the quad, but it displays it scrambled, instead of mirrored.
Any suggestions on how to render the quad with the mirrored texture?
Thanks.
However, i cant figure out to flip it vertically, I tried to swap the UV for the Y portion (cant remember if the Y is the U or the V) when drawing the quad, but it displays it scrambled, instead of mirrored.
Any suggestions on how to render the quad with the mirrored texture?
Thanks.
#3 Members - Reputation: 4605
Posted 15 November 2012 - 12:37 AM
You either need to invert the y coord (y = 1-y) or best to flip the texture before uploading it to the GPU.
Ashaman
My game: Gnoblins
Developer journal about Gnoblins
Small goodies: Simple alpha transparency in deferred shader
My game: Gnoblins
Developer journal about Gnoblins
Small goodies: Simple alpha transparency in deferred shader






