【シェーダ その1】指定した色で描画するシェーダ。
Shader "ShaderLab Tutorials/Combiner" {
Properties {
_Color ("Color", Color) = (0, 0, 1)
_MainTex ("Texture", 2D) = ""
}
SubShader {
Pass {
Color [_Color]
//SetTexture[_MainTex]
}
}
}【シェーダ その2】テクスチャで描画するシェーダ。
Shader "ShaderLab Tutorials/Combiner" {
Properties {
_Color ("Color", Color) = (0, 0, 1)
_MainTex ("Texture", 2D) = ""
}
SubShader {
Pass {
Color [_Color]
SetTexture[_MainTex]
}
}
}【シェーダ その3】UV座標を使わない形(TexGen)でテクスチャで描画するシェーダ。
Shader "ShaderLab Tutorials/Combiner" {
Properties {
_Color ("Color", Color) = (0, 0, 1)
_MainTex ("Texture", 2D) = "" {TexGen ObjectLinear}
}
SubShader {
Pass {
Color [_Color]
SetTexture[_MainTex]
}
}
}[TexGen ObjectLinear] についてはこちらを参照。
Unity - ShaderLab syntax: Properties
http://docs.unity3d.com/Documentation/Components/SL-Properties.html
【シェーダ その4】「テクスチャの色 * テクスチャの色」で描画するシェーダ。暗めのテクスチャの場合、元の色より暗く成ります。「{Combine src1 +- src2}」の様に * の代わりに +- を使用した場合、 src1 に src2 の値を加えた後に0.5を引いた値で描画されます。
Shader "ShaderLab Tutorials/Combiner" {
Properties {
_Color ("Color", Color) = (0, 0, 1)
_MainTex ("Texture", 2D) = ""
}
SubShader {
Pass {
Color [_Color]
SetTexture[_MainTex] {Combine texture * texture}
}
}
}「Combine」についてはこちらを参照。
Unity - ShaderLab syntax: Texture Combiners
http://docs.unity3d.com/Documentation/Components/SL-SetTexture.html
【シェーダ その5】「テクスチャの色」と「プライマリカラー」を掛けあわせた値で描画するシェーダ。
Shader "ShaderLab Tutorials/Combiner" {
Properties {
_Color ("Color", Color) = (0, 0, 1)
_MainTex ("Texture", 2D) = ""
}
SubShader {
Pass {
Color [_Color]
SetTexture[_MainTex] {Combine texture * primary}
}
}
}