Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. UnityGI GetUnityGI(float3 lightColor, float3 lightDirection, float3 normalDirection,float3 viewDirection, float3 viewReflectDirection, float attenuation, float roughness, float3 worldPos)
  2. {
  3. //Unity light Setup ::
  4. UnityLight light;
  5. light.color = lightColor;
  6. light.dir = lightDirection;
  7. light.ndotl = max(0.0h,dot( normalDirection, lightDirection));
  8. UnityGIInput d;
  9. d.light = light;
  10. d.worldPos = worldPos;
  11. d.worldViewDir = viewDirection;
  12. d.atten = attenuation;
  13. d.ambient = 0.0h;
  14. d.boxMax[0] = unity_SpecCube0_BoxMax;
  15. d.boxMin[0] = unity_SpecCube0_BoxMin;
  16. d.probePosition[0] = unity_SpecCube0_ProbePosition;
  17. d.probeHDR[0] = unity_SpecCube0_HDR;
  18. d.boxMax[1] = unity_SpecCube1_BoxMax;
  19. d.boxMin[1] = unity_SpecCube1_BoxMin;
  20. d.probePosition[1] = unity_SpecCube1_ProbePosition;
  21. d.probeHDR[1] = unity_SpecCube1_HDR;
  22. Unity_GlossyEnvironmentData ugls_en_data;
  23. ugls_en_data.roughness = roughness;
  24. ugls_en_data.reflUVW = viewReflectDirection;
  25. UnityGI gi = UnityGlobalIllumination(d, 1.0h, normalDirection, ugls_en_data );
  26. return gi;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement