Hello,
I have been created a mosaic app. This application create a mosaic image from smaller photos. Each photo is a quad with material (color + texture). In runtime single quad will change it color and may change texture too. I have big problem with performance. When camera show whole mosaic i have ~11 fps and ~13.5k batches. I try to optimise it but currently I don’t have any positive results. Maybe anyone have some ideas how I can get better performance?
I recommend rendering what you’ve got working now to a RenderTexture when the mosaic is created, then remove all your quads and render just that one texture to a new quad. Instead of rendering 100+ quads with 100+ instanced materials every frame, you’ll be rendering one quad with one material.
Ok, but I want change color of every quad on runtime. While runtime camera zoom to random tile. During zooming every quad slightly change it color to white. On the maximum zoom we can see big normal photo at the center of screen. Next app do unzoom and then every quad back to it normal color. In case which you described - I think that after merge all quads to one big quad with one material there is no possibility to change each quad color separately.
How much shader experience do you have? If you’re good with shaders, you don’t need to control the color of each quad individually for that effect. You could continue to render the one large quad with the one large texture, then render a large white quad over it with a hole cut out for the one part of the image you don’t want colored. You could use stenciling to cut this hole.
If you’re not good with stenciling, maybe you could render the one large quad turning whiter as a whole, then render just the one image again on top of it in normal color.