Author Topic: About NGUI UI2DSprite change shader's param  (Read 2248 times)

lbddk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
About NGUI UI2DSprite change shader's param
« on: April 01, 2015, 12:44:12 AM »
i made a cum shader for button with ui2dSprite,and i need to change shader's param value.then i found it not work.
i found that ngui use dMat instead of the normal one which we can change. so if i use ui2dSprite.material can only get just like a model not object. so , if i use ui2dSprite.material.setFloat("test",1) that this will not work.

if there is some one know about how to let ui2dSprite.material.setFloat work,please help me and give me some answer thank you .

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: About NGUI UI2DSprite change shader's param
« Reply #1 on: April 01, 2015, 11:24:14 PM »
If you need to set some value in the shader, set the UIWidget.onRender callback and do it inside.