Search code examples
unity-game-enginegraphics3drendereruv-mapping

Are unused texture pixels read by Unity's renderer?


Does Unity's renderer read the entire texture, or only the pixels the UVs overlap?

For example, in the following texture with the following UVs, only rows C, D, E and F are needed. Disregarding the extra storage space the rest of the texture occupies, are there any drawbacks to doing this?

Color grid partially covered with UVs

Does the renderer read the entire texture or only the relevant pixels?


Solution

  • Unity would keep the whole texture in memory. Texture mapping is done in shaders.

    That's why its recommended to try and occupy as much UV space as possible. You can even go further and use same texture for multiple objects.

    Even tho this only covers opengl, it is a good resource for understanding how all of this works. https://learnopengl.com/Getting-started/Textures