上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 60 下一页
摘要: 代码实现: //方向 void Demo02(http://www.amjmh.com/v/BIBRGZ_558768/) { Vector3 pos = this.transform.position; Debug.DrawLine(Vector3.zero, this.transform.pos 阅读全文
posted @ 2019-08-05 18:16 水至清明 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 代码实现: //模长 void Demo01() { Vector3 pos = this.transform.position; Debug.DrawLine(Vector3.zero,this.transform.position); //利用数学公式求模长 float m1 =Mathf.Sq 阅读全文
posted @ 2019-08-05 18:16 水至清明 阅读(368) 评论(0) 推荐(0) 编辑
摘要: uniform mat4 mvp_matrix; //透视矩阵 * 视图矩阵 * 模型变换矩阵uniform mat3 normal_matrix; //法线变换矩阵(用于物体变换后法线跟着变换)uniform vec3 ec_light_dir; //光照方向attribute vec4 a_ve 阅读全文
posted @ 2019-08-05 18:15 水至清明 阅读(418) 评论(0) 推荐(0) 编辑
摘要: 图像纹理有两种 一种是平面2d纹理,另一种是盒纹理,针对不同的纹理类型有不同访问方法. 纹理查询的最终目的是从sampler中提取指定坐标的颜色信息. 函数中带有Cube字样的是指 需要传入盒状纹理. 带有Proj字样的是指带投影的版本. 以下函数只在vertex shader中可用: vec4 t 阅读全文
posted @ 2019-08-05 18:15 水至清明 阅读(551) 评论(0) 推荐(0) 编辑
摘要: 有的时候我们自己给Arduino编好了程序,又希望在Matlab中调用串口,读取数据。此时 Matlab Support Package for Arduino显然不合适了。这里我们要用到Matlab里的串口对象serial。比如当我们需要利用Matlab处理摄像头画面,结合摄像头标定、摄像头识别、 阅读全文
posted @ 2019-08-05 18:14 水至清明 阅读(2452) 评论(0) 推荐(0) 编辑
摘要: 蒙版代码: // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' Shader "Custom/UnlitStencilMaskVF" { SubShader { Tags { "Rend 阅读全文
posted @ 2019-08-05 18:13 水至清明 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Shader "Custom/UnlitStencilVF" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {}} SubShader { Tags { "Queue" = "Geometry""RenderType"="Opaque" } 阅读全文
posted @ 2019-08-05 18:13 水至清明 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 代码如下:胶囊体(先渲染Geometry+1): Shader "SoulCoder/Mask" { SubShader { Tags { "RenderType"="Opaque" "Queue"="Geometry+1"} ColorMask 0 ZWrite off Stencil { Ref 阅读全文
posted @ 2019-08-05 18:12 水至清明 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Shader "SoulCoder/Model" { Properties { _Color ("Main Color", Color) = (1,1,1,0) } SubShader { Tags { "RenderType"="Opaque" "Queue"="Geometry+2"} Colo 阅读全文
posted @ 2019-08-05 18:12 水至清明 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Shader "Unlit/StentilOutline"{ Properties { _MainTex ("Texture", 2D) = "white" {} _Outline("OutLine",range(0,1))=0 } SubShader { Tags { "RenderType"=" 阅读全文
posted @ 2019-08-05 18:10 水至清明 阅读(307) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 60 下一页