2018年7月17日
摘要: 1.像素>>顶点数>>物体个数:shader中的计算应首先考虑放在script,其次vert,最后frag中 2.尽量用精度小的类型替换精度大的类型(特别是在frag中,要尽可能的保持低精度计算,类型转换代价昂贵,手机上支持低精度计算):省电,快 3.forwardAdd这个tag能不用就不用,因为 阅读全文
posted @ 2018-07-17 18:48 魔天天 阅读(1464) 评论(0) 推荐(0) 编辑
摘要: shader中的宏定义在material中Inspector中打开 阅读全文
posted @ 2018-07-17 16:35 魔天天 阅读(2341) 评论(0) 推荐(0) 编辑
摘要: //测试viewDir对顶点的影响Shader "Example/TestViewDir" { Properties{ _RimColor("Rim Color", Color) = (0.26,0.19,0.16,0.0) _RimPower("Rim Power", Range(0.5,8.0)) = 3.0 } SubShader{ Tags{ "RenderType... 阅读全文
posted @ 2018-07-17 12:19 魔天天 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 参考自:https://en.wikibooks.org/wiki/GLSL_Programming/Unity/Soft_Shadows_of_Spheres 阅读全文
posted @ 2018-07-17 11:38 魔天天 阅读(256) 评论(0) 推荐(0) 编辑