Quantcast
Channel: Questions in topic: "native plugin"
Viewing all articles
Browse latest Browse all 376

Is Texture.apply() for Unity == glTexSubImage2D on native side on Unity

$
0
0
I have a texture in Unity which I will modify frequently. Now there are two options: 1. I can make changes to texture by calling setPixels and then call Texture2D.apply. I think the apply actually copies the data from CPU to GPU. 2. One option is I can modify the texture in native code by getting the texture native handle and modifying it using glTexSubImage2D functions. Now I read the apply copies only the changed pixels to GPU not full texture but I really doubt if its possible. but if it is true does this mean that calling Texture2D.apply == glTexSubImage2Din terms of performance. If not, what should I use if I need good performance. I actually dont want to go to native side as I will have to manage the native code on for different graphics APIs supported by Unity like opengl, DX etc

Viewing all articles
Browse latest Browse all 376

Trending Articles