Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. inline half3 getEnvironmentReflection(in SurfaceData data, in half3 bakedLighting)
  2. {
  3.     half3 c = bakedLighting * data.diffuse * data.occlusion;
  4.  
  5.     half3 irradiance = getEnvironmentMap(data, unity_SpecCube0_HDR) * data.occlusion;
  6.  
  7.     half surfaceReduction = 1.0h / (data.roughness2 + 1.0h);
  8.  
  9.     half NdotV = dot(data.normal, data.view);
  10.     half fresnelTerm = pow5(1.0h - saturate(NdotV));
  11.  
  12.     c += surfaceReduction * irradiance * lerp(data.specular, data.grazingTerm, fresnelTerm);
  13.     return c;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement