I’d like to do a surface shader with a custom lighting model but still implement the standard specular behaviour where reflection probes are picked up. I’d also like to implement the standard gi. Basically I want the standard shader but with access to a custom lighting function. Could anyone point me in the right direction?
Shader "Eastshade 2/Standard" {
Properties {
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Custom
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
struct SurfaceOutputCustom {
fixed3 Albedo;
fixed3 Normal;
fixed3 Emission;
fixed Specular;
fixed Gloss;
fixed Alpha;
};
half4 LightingCustom_Deferred(SurfaceOutputCustom s, UnityGI gi, out half4 outDiffuseOcclusion, out half4 outSpecSmoothness, out half4 outNormal) {
half4 c = half4(s.Albedo, s.Alpha);
outDiffuseOcclusion = half4(s.Albedo, 0);
outSpecSmoothness = half4(s.Specular, s.Specular, s.Specular, s.Gloss);
outNormal = half4(s.Normal * 0.5 + 0.5, 1);
//maybe I put the spec here?
return c;
}
inline void LightingCustom_GI( SurfaceOutputCustom s, UnityGIInput data, inout UnityGI gi ) {
//maybe I put the spec here?
}
void surf (Input IN, inout SurfaceOutputCustom o) {
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * .25;
o.Albedo = c.rgb;
o.Emission = 0;
o.Specular = 0;
o.Gloss = 0;
o.Alpha = 1;
}
ENDCG
}
FallBack "Diffuse"
}