LitMetaPass.hlsl 716 B

12345678910111213141516171819
  1. #ifndef UNIVERSAL_LIT_META_PASS_INCLUDED
  2. #define UNIVERSAL_LIT_META_PASS_INCLUDED
  3. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UniversalMetaPass.hlsl"
  4. half4 UniversalFragmentMetaLit(Varyings input) : SV_Target
  5. {
  6. SurfaceData surfaceData;
  7. InitializeStandardLitSurfaceData(input.uv, surfaceData);
  8. BRDFData brdfData;
  9. InitializeBRDFData(surfaceData.albedo, surfaceData.metallic, surfaceData.specular, surfaceData.smoothness, surfaceData.alpha, brdfData);
  10. MetaInput metaInput;
  11. metaInput.Albedo = brdfData.diffuse + brdfData.specular * brdfData.roughness * 0.5;
  12. metaInput.Emission = surfaceData.emission;
  13. return UniversalFragmentMeta(input, metaInput);
  14. }
  15. #endif