Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Lustabel on January 31, 2017, 06:28:55 PM
-
I'm using a custom shader, but I cannot find the arguments at NGUI script to change the material tint color to apply it to my custom shader.
(http://lustabel.eu/Arts/paneluisprite.png)
Thank you very much for the help.
-
Would be enough for me to find the object to access to it's current material to edit it and assign it to the object via script.
-
NGUI widgets color is effectively baked as vertex colors when the widget geometry gets created and sent to the GPU. It's not a part of the material.
Furthermore, since you didn't specify an explicit material on your sprite, it means NGUI will batch this sprite with all the other sprites using the same atlas underneath its parent panel. So there is no "one" draw call for the sprite. There is one draw call for all the sprites -- and as such only one material. You can listen to UIWidget.onRender to get the final material, but like I said it will be a batched material for all of your widgets in the batched draw call.