Unity3d shader -- fixed function shader
来源:互联网 发布:java游戏引擎制作 编辑:程序博客网 时间:2024/04/25 11:44
这种shader种类简单,效果单一
主要包含: properties, material, lighting, settexture, pass(通道)
样式:
SubShader{
[propertie]
subshader{}
[fallback]
}
值类型: color, range, 2D
此类shader必须要有pass通道
小括号代表固定值,中括号代表变量值
关键词:
pass: 通道
material:材质
diffuse:漫反射
lighting: 光照,on/off
ambient: 环境光
specular: 高光。
separatespecular on 使用高光之后必须添加
shininess: 浮点值,用于描述specular的强度,表示高光部分的集中度,一般用范围【0-8】
emission: 自发光
settexture: 纹理,参数是2D类型,可以混合多个纹理,不同的显卡能混合的纹理上限不同
combine: 合并
primary: settexture中专用的关键词,表示合并顶点光照参数,还可以乘以一个值,增加曝光度
previous: combine用,合并之前的结果,区别于primary
double,quad 双倍,四倍
例子:
Shader "Custom/CustomShader" { Properties { _Color ("Color", Color) = (1 ,1, 1,1 ) _Ambient ("Ambient", Color) = (1 ,1, 1,1 ) _Specular ("Specular", Color) = (1 ,1, 1,1 ) _Shininess ("Shininess", Range(0 ,8)) = 4 _Emission( "Emission",color ) = (0.1, 0.1,0.1 ,0.1) } SubShader { pass{ color[_Color] material { diffuse[_Color] ambient[_Ambient] specular[_Specular] shininess[_Shininess] emission[_Emission] } lighting on separatespecular on } }}例子2:透明材质shaderShader "Custom/CustomShader" { Properties { _Color ("Color", Color) = (1 ,1, 1,1 ) _Ambient ("Ambient", Color) = (0.3 ,0.3, 0.3,0.3 ) _Specular ("Specular", Color) = (1 ,1, 1,1 ) _Shininess ("Shininess", Range(0 ,8)) = 4 _Emission( "Emission",color ) = (0.1, 0.1,0.1 ,0.1) _MainTex("MainTex", 2D)="" {} _SecontTex("SecondTex", 2d) ="" {} _TransparentColor("TransparentColor", color) = (1 ,1, 1,0.3 ) } SubShader { //队列,描述此shader属于何种类型,和渲染顺序 Tags { "Queue" = "Transparent" } pass{ //透明混合模式 Blend SrcAlpha OneMinusSrcAlpha material { diffuse[_Color] ambient[_Ambient] specular[_Specular] shininess[_Shininess] emission[_Emission] } lighting on separatespecular on settexture[_MainTex] { combine texture * primary double } settexture[_SecontTex] { constantcolor[_TransparentColor ] combine texture * previous double, constant } } }}
0 0
- Unity3d shader -- fixed function shader
- Unity Shader--fixed function shader
- [Unity Shader] Fixed Function Shader
- Fixed Function Shader
- Fixed function Shader 1
- Fixed function Shader 2
- Fixed function Shader 3
- Shader第二讲 Fixed Function Shader
- Shader第二讲:Fixed Function Shader
- Shader学习之Fixed function shader 简介
- Unity - Fixed function shader学习
- Fixed Function Shader(固定渲染管线)
- unity shader的固定管线(fixed function shader)
- Unity3D shader(1)——fixed shader
- Shader编程学习笔记(五)—— 固定管线shader (Fixed function shader)_1
- Shader编程学习笔记(六)—— 固定管线shader (Fixed function shader)_2
- Unity3d Shader
- unity3d shader
- Bootstrap排版的类 做web前端开发的你精通吗?
- c++总结
- html标签汇总,介绍(新手入门可以瞅瞅)
- Java线程中sleep()、wait()和notify()和notifyAll()、yield()、join()等方法的用法和区别
- cuda stream处理
- Unity3d shader -- fixed function shader
- 地图与定位(六)高德地图服务二
- 基于标题分类的文章主题句识别与提取方法
- git协同开发流程定制
- CLR寄宿和APPDomain
- test保存到code代码片
- Android书签
- A+B Problem
- 【leetcode】19. Remove Nth Node From End of List