Game Development Reference
In-Depth Information
Engage thrusters
This is the last section, after which you will be able to see the result of your custom shader:
1. Go to MonoDevelop , open the MyShader file, go to the Properties section,
and add the highlighted script as follows:
Properties {
_BumpMap ("Bumpmap", 2D) = "bump" {}
_RimColor ("Rim Color", Color) = (0.07, 0.2, 0.42,
1.0)
_RimPower ("Rim Power", Range(0.01,8)) = 7
_Ramp ("Ramp Texture", 2D) = "gray" {}
}
2. Go to the SubShader section and add the highlighted code as follows:
SubShader {
Tags { "RenderType"="Opaque" }
LOD 400
CGPROGRAM
#pragma surface surf RampSpecular
exclude_path:prepass
fixed4 _AmbientColor;
fixed4 _SpecularColor;
half _Shininess;
sampler2D _MainTex;
sampler2D _BumpMap;
fixed4 _RimColor;
half _RimPower;
sampler2D _Ramp;
struct Input {
float2 uv_MainTex;
float2 uv_BumpMap;
fixed3 viewDir;
Search WWH ::




Custom Search