LightingMetaPass.hlsl 940 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef SG_LIT_META_INCLUDED
  2. #define SG_LIT_META_INCLUDED
  3. PackedVaryings vert(Attributes input)
  4. {
  5. Varyings output = (Varyings)0;
  6. output = BuildVaryings(input);
  7. PackedVaryings packedOutput = (PackedVaryings)0;
  8. packedOutput = PackVaryings(output);
  9. return packedOutput;
  10. }
  11. half4 frag(PackedVaryings packedInput) : SV_TARGET
  12. {
  13. Varyings unpacked = UnpackVaryings(packedInput);
  14. UNITY_SETUP_INSTANCE_ID(unpacked);
  15. SurfaceDescriptionInputs surfaceDescriptionInputs = BuildSurfaceDescriptionInputs(unpacked);
  16. SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
  17. #if _AlphaClip
  18. clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold);
  19. #endif
  20. MetaInput metaInput = (MetaInput)0;
  21. metaInput.Albedo = surfaceDescription.Albedo;
  22. metaInput.Emission = surfaceDescription.Emission;
  23. return MetaFragment(metaInput);
  24. }
  25. #endif