Advertisement
romanilyin

func

Mar 15th, 2024
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | Gaming | 0 0
  1. void PBR_float(float3 positionWS, half3 normalWS, half3 normalTS, half3 viewDirectionWS, half3 bakedGI, half3 albedo,
  2. half metallic, half3 specular, half smoothness, half occlusion, half3 emission, half alpha, half clearCoatMask, half clearCoatSmoothness, out float3 Color)
  3. {
  4. #if defined(SHADERGRAPH_PREVIEW)
  5. Color = float3(1, 1, 1);
  6. #else
  7. InputData inputData;
  8. inputData.positionWS = positionWS;
  9. inputData.normalWS = NormalizeNormalPerPixel(normalWS);
  10. inputData.viewDirectionWS = SafeNormalize(-viewDirectionWS);
  11. inputData.shadowCoord = half4(0, 0, 0, 0);
  12. inputData.fogCoord = 0;
  13. inputData.vertexLighting = half3(0, 0, 0);
  14. inputData.normalizedScreenSpaceUV = half2(0, 0);
  15. inputData.shadowMask = half4(0, 0, 0, 0);
  16. inputData.bakedGI = bakedGI;
  17.  
  18. SurfaceData surfData;
  19. surfData.albedo = albedo;
  20. surfData.specular = specular;
  21. surfData.metallic = metallic;
  22. surfData.smoothness = smoothness;
  23. surfData.normalTS = normalTS;
  24. surfData.emission = emission;
  25. surfData.occlusion = occlusion;
  26. surfData.alpha = alpha;
  27. surfData.clearCoatMask = clearCoatMask;
  28. surfData.clearCoatSmoothness = clearCoatSmoothness;
  29.  
  30. Color = UniversalFragmentPBR(inputData, surfData);
  31. #endif
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement