Unity3D PerRendererData

时间:2015-05-19 20:34:59   收藏:0   阅读:304

http://nordicedu.com/tkokblog/wordpress/?tag=perrendererdata

 

MaterialPropertyBlock and SpriteRenderer

Once again the “Unity-way” supraised me. I made this simple Dissolve shader for sprites. There were many difficulties on a way but the most ambiguous one was releated to SpriteRenderer and MaterialPropertyBlock.

When you do your own shader for sprites and want to use the MaterialPropertyBlock to send some [PerRendererData] you have to use Renderer.GetMaterialPropertyBlock first becouse Unity uses MaterialPropertyBlocks internaly for Sprite rendering and you don’t want to mess it up.

 

 

 

Posted in Uncategorized Tagged ,

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!