Skip to content

Instantly share code, notes, and snippets.

@toxicFork
Created March 14, 2015 23:53
Show Gist options
  • Save toxicFork/2f90ae80f59bc04e3962 to your computer and use it in GitHub Desktop.
Save toxicFork/2f90ae80f59bc04e3962 to your computer and use it in GitHub Desktop.
half4 fragForwardBase (VertexOutputForwardBase i) : SV_Target
{
FRAGMENT_SETUP(s)
PLANE_CLIP(s.posWorld)
UnityLight mainLight = MainLight (s.normalWorld);
half atten = SHADOW_ATTENUATION(i);
half occlusion = Occlusion(i.tex.xy);
UnityGI gi = FragmentGI (
s.posWorld, occlusion, i.ambientOrLightmapUV, atten, s.oneMinusRoughness, s.normalWorld, s.eyeVec, mainLight);
half4 c = UNITY_BRDF_PBS (s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, -s.eyeVec, gi.light, gi.indirect);
c.rgb += UNITY_BRDF_GI (s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, -s.eyeVec, occlusion, gi);
c.rgb += Emission(i.tex.xy);
UNITY_APPLY_FOG(i.fogCoord, c.rgb);
return OutputForward (c, s.alpha);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment