Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: RenderTexture Issues.  (Read 9835 times)

0 Members and 1 Guest are viewing this topic.

Ezekiel

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: RenderTexture Issues.
« Reply #15 on: August 22, 2013, 07:20:40 pm »
I see, I found a reference on the net, that's how I came upon RenderTexture.

My plan is to render a complex image, copy to few new images, change a few colors, Render different Text on each, and then sprite them.  And possibly, if the rendering takes too much time, save them to files.

RenderTexture handles the rendering, however, it doesn't seem to have the Image's "save", "saveToFile", "GetPixel", or "SetPixel" ability.  I will require to duplicate the complex rendered item, then the "GetPixel and "SetPixel" functions are used to change the color (of course, with some comparison between the functions).  Is it possible to use the RenderTesture class in a similar way?

I'm not currently using the flipHorizontally and flipVertically, but that may also be beneficial to have at some point.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: RenderTexture Issues.
« Reply #16 on: August 22, 2013, 08:11:18 pm »
Use Texture::copyToImage and Texture::loadFromImage to switch between textures and images.  Use RenderTexture::getTexture to get at the texture created by drawing stuff to your rendertexture.

All these conversions take time, but because they exist everything you just described is entirely possible, even if you have to go through a few extra functions and/or temporary objects to make it work.

Ezekiel

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: RenderTexture Issues.
« Reply #17 on: August 22, 2013, 10:13:27 pm »
Excellent suggestion!  I figured I was missing something, and using Texture was the only place I did not look at, I figured I was already using the RenderTexture and it would do all Texture functions.  Perhaps I was also convinced I couldn't copy the RenderTexture to an image because it is based on NonCopyable.  Things aren't always as they seem.

Thank you for helping.  I will try that as soon as possible.