Unity Shader - 属性定义 ShaderLab : Properties 和 CG 属性
来源:互联网 发布:python basehttpServer 编辑:程序博客网 时间:2024/06/04 20:14
(1)ShaderLab Properties 可用类型
- 数值和滑条类型
- 范围浮点数 Range 例如:_MatRange(“Material Range Val”, Range (-10, 10)) = 1
- 浮点数 Float 例如:_MatFloat(“Material Float Val”, Float) = 1
- 整数 Int 例如:_MatInt(“Material Int Val”, Int) = 1
- 颜色和向量类型
- 颜色 Color 例如: _MatColor(“Material Color Val”, Color) = (1,1,1,1)
- 四元素向量 Vector 例如: _MatVector(“Material Vector Val”, Vector) = (1,1,1,1)
- 图片类型
- 普通贴图 2D 例如: _Mat2D(“Material 2D Texture Val”, 2D) = “defaulttexture” {}
- 正方体贴图 Cube 例如: _MatCube(“Material Cube Texture Val”, Cube) = “defaulttexture”{}
- 3D贴图 3D 例如: _Mat3D(“Material 3D Texture Val”, 3D) = “defaulttexture”{}
- 矩阵
- float4x4
(2) unity脚本控制属性
public Cubemap m_cubeMap;public Texture3D m_texture3D;void Start (){ Material mat = gameObject.GetComponent<Renderer>().material; Texture texture2D = transform.GetChild(0).GetComponent<Renderer>().material.mainTexture; mat.SetFloat("_MatRange", 2); mat.SetFloat("_MatFloat", 3); mat.SetInt("_MatInt", 0); mat.SetColor("_MatColor", Color.black); mat.SetVector("_MatVector", Vector4.one); mat.SetTexture("_Mat2D", texture2D); mat.SetTexture("_MatCube", m_cubeMap); mat.SetTexture("_Mat3D", m_texture3D);}
(3)CG属性
- sampler2D _CG2D;
- float4 _CGFloat4 ;
- sampler
0 0
- Unity Shader - 属性定义 ShaderLab : Properties 和 CG 属性
- Unity3D ShaderLab<二>Shader属性
- Unity3D ShaderLab<二>Shader属性
- Cg入门9:Vertex Shader - Uniform 与 properties属性
- Accessing shader properties in Cg/HLSL //访问cg/hlsl中的着色属性
- Unity Shader 学习笔记(2)Shader、ShaderLab、Cg/HLSL/GLSL
- Unity Shader修改Shader属性
- unity shader:初探shaderlab
- unity修改材质属性和更换shader
- Unity Shader 属性及标签
- Unity ShaderLab 笔记2 Properties
- ShaderLab基础(属性)
- UNITY3D shader学习心得<一> properties属性接口
- Shader学习 之 ShaderLab语法:Properties
- Shader学习 之 ShaderLab语法:Properties
- Unity Shader--- CG 标准函数库
- Unity ShaderLab 笔记1 shader 结构
- Unity Shader(ShaderLab)着色器简介
- MySql 如果字段为NULL则返回0
- windows安装java/jdk
- Swift语言 OS X程序点击dock图标重新弹出窗口方法
- 黑马程序员-IOS学习笔记 C语言编程时常犯十八个错误
- servlet
- Unity Shader - 属性定义 ShaderLab : Properties 和 CG 属性
- Ecmascript-262-3 in detail. Chapter 4. Scope chain.
- centos 7 启动tomcat服务
- UVA 111 History Grading(最长公共子序列dp)
- 同位语
- Leetcode23-Merge k Sorted Lists
- 整数的二进制表示中有多少个1的问题
- UIButton 的各种状态的选择
- 删除文件及文件夹