nbannister

Unity LightweightPBR Custom Node

Sep 23rd, 2019
1,977
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. void LightweightPBR_float
  2. (float3 Albedo,
  3. float Metallic,
  4. float3 Specular,
  5. float Smoothness,
  6. float Occlusion,
  7. float3 Emission,
  8. float Alpha,
  9. float3 PositionWS,
  10. float3 NormalWS,
  11. float3 ViewDirectionWS,
  12. float FogCoord,
  13. float3 VertexLighting,
  14. float3 BakedGI,
  15. out float4 fragOut) {
  16.  
  17. fragOut = float4 (1,1,1,1);
  18.  
  19. #ifdef LIGHTWEIGHT_INPUT_INCLUDED
  20. InputData inputData;
  21. inputData.positionWS = PositionWS;
  22. inputData.normalWS = NormalWS;
  23. inputData.viewDirectionWS = ViewDirectionWS;
  24. inputData.shadowCoord = GetShadowCoord(GetVertexPositionInputs(PositionWS));
  25. inputData.fogCoord = FogCoord;
  26. inputData.vertexLighting = VertexLighting;
  27. inputData.bakedGI = BakedGI;
  28. fragOut = LightweightFragmentPBR(inputData, Albedo, Metallic, Specular, Smoothness, Occlusion, Emission, Alpha);
  29. # endif
  30. }
Add Comment
Please, Sign In to add comment