Hi all,
I’m using RenderTextures to produce a system which is an off-line renderer in Unity. The issue is that, in order to read the data from a Render Texture, I need to grab it to a Texture 2D, then Apply it, and then read from the resultant texture.
Even though the Render Texture is relatively small from a resolution point of view, due to the fact I’m having to do this ‘transfer to Texture2D’ step over and over again, it’s taking an incredible amount of time to do something which really shouldn’t take so long.
It seems that the bottle-neck is the ‘Apply’ part of this whole process.
I’m working on PC, and I’d really like to speed this process up massively. As such, I was wondering if there’s any way to ‘bypass’ either the Apply part of this (as I don’t actually need the content of the resultant texture, just the data), or perhaps even read (and intepret) the content of the Rendertexture (or Texture2D) using GetNativePtr function?
I’ve been googling this for days, and have found a few vague descriptions of plugins that I could write myself, but they all have hardcore limits which I can’t really accept (like forcing OpenGL mode, for example - when I’m using DX11).
Alternatively, is there any way to just blit a section of a RenderTexture onto another texture without having to run ‘Apply’ on the final texture (so I can essentially write to it many times before finally calling Apply?).
There has to be some way to do this that doesn’t cause the whole system to just grind to a halt!
Anyone?