Hi guys, two questions on optimization.
First question: We have one texture for a bunch of objects that share uv map, we need to use two different shaders, one diffuse and one transparent. Ex. A car with a diffuse chassis and transparent windows.
This will result in the windows having a large texture, but only occupying a small part of it. Will this have any performance impact if all the objects are shown at the same time (the texture needs to be loaded anyway), or is it just bad practice?
Second question: If I make a tiny texture 4x4 pixels but repeat it a million times over some large geometry what performance issues will that bring?
Thanks for your time!
Lars
Replies
When your textures are compressed, an alpha channel doubles the size of the compressed texture. So you're better off using 1 large 24 bit texture, and one smaller set of textures at a reduced resolution with alpha.
Generally, its much better to only have alpha in the shader on the areas you need it, so using two shaders/draw calls is more beneficial than keeping it all in 1 material but drawing alpha where you don't need to. This may vary a bit depending on specifically how your engine works but will usually be the case.
Tiling a small texture many times should have no effect on performance.