Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "${ShaderName}"
- {
- Properties
- {
- ${ShaderProperties}
- }
- SubShader
- {
- Tags
- {
- ${Tags}
- }
- ${GrabPass}
- ${Options}
- CGPROGRAM
- #pragma surface surf BlinnPhongEditor ${SurfaceFlags}
- ${ShaderPragma}
- ${ShaderVariableNames}
- struct EditorSurfaceOutput {
- half3 Albedo;
- half3 Normal;
- half3 Emission;
- half3 Gloss;
- half Specular;
- half Alpha;
- half4 Custom;
- };
- inline half4 LightingBlinnPhongEditor_PrePass (EditorSurfaceOutput s, half4 light)
- {
- ${LightingFunctionPrePass}
- }
- inline half4 LightingBlinnPhongEditor (EditorSurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
- {
- half3 h = normalize (lightDir + viewDir);
- half diff = max (0, dot ( lightDir, s.Normal ));
- float nh = max (0, dot (s.Normal, h));
- float spec = pow (nh, s.Specular*128.0);
- half4 res;
- res.rgb = _LightColor0.rgb * diff;
- res.w = spec * Luminance (_LightColor0.rgb);
- res *= atten * 2.0;
- return LightingBlinnPhongEditor_PrePass( s, res );
- }
- struct Input {
- ${StructInputs}
- };
- void vert (inout appdata_full v) {
- ${VertexShader}
- ${VertexShaderMods}
- }
- void surf (Input IN, inout EditorSurfaceOutput o) {
- o.Normal = float3(0.0,0.0,1.0);
- o.Alpha = 1.0;
- o.Albedo = 0.0;
- o.Emission = 0.0;
- o.Gloss = 0.0;
- o.Specular = 0.0;
- o.Custom = 0.0;
- ${SurfaceShader}
- o.Normal = normalize(o.Normal);
- }
- ENDCG
- }
- Fallback "${Fallback}"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement