- Home /
1 Big texture, 2 materials?
If I need 2 different materials, and use the same texture in both, is there a difference compared to using separate textures for the materials? One material shader is much more complex than the other material shader.
Example: 2 materials, 1 texture(4096 resolution) VS 2 material, 2 textures(2048 resolution).
The things using these materials/texture(s) will be in view always at once, but I cannot just use one material in my situation.
thank you
Answer by Invertex · Jan 02, 2014 at 05:58 AM
sparkzbarca's answer is partly incorrect actually. Both dimensions should be power of 2 values, but they don't need to be the same value. For example, there is nothing wrong with having a 1024x2048 or even 128x8192 texture, these are still power of 2 textures, and is how sprite sheets are handled, they are almost never square, but rectangle.
To answer OP's question properly, it depends on what OP would like to do with the objects that have those materials on them. If for example 1 object is in the scene for most of the time, but the object with the other material is spawned in frequently, it would make sense to have it on the same texture atlas. As the game wouldn't need to keep doing a texture load every time you spawned that object, since an object in the scene is already using that texture file. Or, if they are both usually in the scene together, it makes sense as well. Especially if they are part of the same object/prop/prefeab/etc...
So the answer is that most of the time it is more efficient to bundle the textures like that if you know the whole texture is going to be used in the scene most of the time.
Answer by sparkzbarca · Jan 02, 2014 at 04:19 AM
umm how can you possibly do that unless your wasting huge amounts of texture space.
The issue is that textures should be powers of 2 (or square shaped)
so to go from 1 texture to more than 1 effectively your next amount would be 4
to have it 2 textures wide you need it 2 textures high, the next after that is of course 9 textures
or any texture should have X^2 textures in it, with 1^2 of course being 1 still
a 4096 X 4096 texture is 4 times as big as a 2048X2048
just like
2X2 is 4 times as big as 1X1
so to answer your question there is no way to effectively store 2 equally sized textures in 1 texture, split them into 2, or add 2 more.
Mark as answered and have a nice day!
@Invertex, yes that is what I was trying to get at, rather than specifically texture resolution. I was mostly inquiring on performance of 2 mat + 1 text vs 2 mat + 2 tex, with mat's being vastly different shader wise. So thank you for addressing that for me. :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613125326im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
new Color() not working properly? 1 Answer
Multiple textures in one material 0 Answers
Transparent block changes transparency when other blocks are placed 0 Answers
Visual/Texture anomoly .... Never seen this before, image attached 1 Answer
Runtime mesh generation material problem (Distort on textures when i scaled mesh) 0 Answers