Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: steddyman on November 21, 2012, 10:42:27 AM
-
"You can organize sprites into groups by creating more than one atlas. As long as the atlases share the same material, their widgets will still end up in the same draw call."
How can one material point to multiple different textures?
-
This is the definition of an atlas.
On a single texture (an atlas), you pack different textures, and this atlas is linked to a single material.
There's also a config file that keeps track of the position of each textures in the atlas.
So when you want to render a sprite, you know what UV coordinates you have to pass to the mesh.
-
You point to a sub-part of a texture with an atlas, so it's still just one texture being used, just only part of it at once.
-
Sorry, that isn't what the documentation states.
I know an atlas is multiple textures combined into an Atlas, that is there entire purpose.
The statement on the UIAtlas page states you can have multiple Atlases (not textures) share the same material.
Here is the link, look at the tips:
http://www.tasharen.com/?page_id=120
-
Ah, hmm, that doesn't make sense. If you're using a different atlas, it will be a different draw call the way it is now. Not sure you can share the material/drawcall like that?
-
"You can organize sprites into groups by creating more than one atlas. As long as the atlases share the same material, their widgets will still end up in the same draw call."
He is saying that one atlas = one material here.
It's just that you can organize your sprites in different atlas, for example :
GameAtlas (with 20 sprites in it)
MenuAtlas (with 50 sprites in it)
And each of these atlases have a single material (GameAtlasMaterial and MenuAtlasMaterial).
The widgets you create using the GameAtlas will have the same draw call (draw call #1) and the widgets you create using the MenuAtlas will have the same draw call too (draw call #2).
-
Really?
I don't think there is any way you can read this to mean that:
'As long as the atlases share the same material'.... how can Altases ever share the same material?
Who wrote that on the website, was it Aren? If so, could you please comment Aren or update the website if it means the above?
-
There is no need to do this anymore. It was marginally useful for manually-created atlases with a lot of sprites before the sprite selection window was added. Now... I'll just remove that line.
-
Thanks for the clarification