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

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.

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!