Hi,
I have multiple materials with different properties (color tints) using a refractive shader.
Instead of using GrabPass, would SetGlobalTexture with the source RenderTexture of OnRenderImage be faster? They both seem to produce comparable visual results. I’m just wondering which would be theoretically more performant.
And if I instead had a single material shared among my meshes, would that affect this comparison? I’m just wondering if GrabPass does any optimizations.
Thanks!
A shared material with the color information in for example the vertex color would be faster. In that case the objects could be batched or at least would need less setpass calls. I guess it also comes down to how many objects you really have with that material. You can also use the framedebugger to take alook how many draw calls are needed right now and how much better it gets if you just use one material.
I really like using GlobalTextures, I didn’t notice any performance issues from them. I guess storing the rendertexture in a global texture would end in using the last frame for your refractive image, right?
I can’t really say if it is better, but from my gut feeling I would say it should be faster, if the meshes cover a lot of the screen. I think grabpass only takes the pixels it needs, but I’mnot completly sure about that.