Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: peaj on August 26, 2014, 03:48:24 AM
-
Hi,
I try to set 2 colors in my custom shader on a UITexture via script. The shader is nearly identical to the "Unlit - Transparent Color" shader except there are 2 additional
color properties and small changes in the fragment shader to make use of those.
In another thread I read it is recommended to change custom shader parameters via "widget.drawCall.dynamicMaterial".
I tried this but now I got the problem that the set parameters are reset every frame.
Even if I set the colors in Update it seems like every second frame is rendered without colors set.
So how can I persistently set custom shader parameters via script?
Best regards,
Pascal
-
http://www.tasharen.com/forum/index.php?topic=10960.0
-
Thx for your fast reply, but I could not find onRender anywhere.
Autocomplete does not show it and even in the documentation of UIWidget
I could not find it. Neither in UIWidget nor in UITexture.
Maybe sth. changed?
-
Sounds like your version of NGUI is not up to date.
-
Yeah thx I just read it in the other thread, too.
I was a little bit confused because the NGUI documentation wasnt up to date either.
I'll try it out as soon as we are able to update NGUI.