上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
摘要: 由于unity中距离较近的2个billboard物体会动态合批,如果缩放不同,显示就有问题。还得在shader中"DisableBatching"="true" 究其原因,是因为billboard是由局部坐标系的顶点和uv中的偏移来计算中心点,再将其转换到世界空间坐标系下,进行伸展。 但是由于静态合 阅读全文
posted @ 2018-03-12 14:44 露夕逝 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 不错的文章 http://www.cnblogs.com/zhanlang96/p/4691553.html 阅读全文
posted @ 2018-03-09 14:41 露夕逝 阅读(310) 评论(0) 推荐(0) 编辑
摘要: // Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' Shader "Custom/CoverSnow" { Properties { _MainTex ("Texture", 2D) = "white" {} _SnowLevel ("Snow Level", ... 阅读全文
posted @ 2018-03-09 10:42 露夕逝 阅读(400) 评论(0) 推荐(0) 编辑
摘要: //45是监控范围为0-45m,*15/255是将这段0-45的深度值映射到颜色的后4位上(后4位0-15) o.depth=float2(saturate(distance(worldPos,_WorldSpaceCameraPos)/45)*15/255,1); float depth=tex2 阅读全文
posted @ 2018-02-02 17:37 露夕逝 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 1.二维数组定义 int[,] arr = new int[len0, len1]; 定义一个len0行,len1列的二维数组,这里的len0,len1指的是GetLength(index) 2.遍历方式 int[,] arr = new int[len0, len1]; for (int i = 阅读全文
posted @ 2018-01-26 11:39 露夕逝 阅读(1083) 评论(0) 推荐(0) 编辑
摘要: pro 阅读全文
posted @ 2017-11-06 15:07 露夕逝 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 总结以上四条得到ref和out使用时的区别是: ①:ref指定的参数在函数调用时候必须初始化,不能为空的引用。而out指定的参数在函数调用时候可以不初始化; ②:out指定的参数在进入函数时会清空自己,必须在函数内部赋初值。而ref指定的参数不需要。 阅读全文
posted @ 2017-10-31 10:32 露夕逝 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Matrix4x4 矩阵api介绍 Namespace: UnityEngine Namespace: UnityEngine Description 描述 A standard 4×4 transformation matrix. 一个标准的4×4变换矩阵。 A transformation ma 阅读全文
posted @ 2017-10-26 11:45 露夕逝 阅读(2569) 评论(0) 推荐(0) 编辑
摘要: 旋转向量:(将向量(0,0,1)绕y轴旋转90度,变成了(1,0,0)) float angle = Mathf.Deg2Rad*90; Matrix4x4 matrix = new Matrix4x4(new Vector4(Mathf.Cos(angle), 0, -Mathf.Sin(angl 阅读全文
posted @ 2017-10-25 17:04 露夕逝 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 首先是shader的基础结构: 然后 Properties面板的定义: 实际代码: 面板效果: 阅读全文
posted @ 2017-10-18 15:31 露夕逝 阅读(750) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页