UnlitPass.hlsl 865 B

123456789101112131415161718192021222324252627
  1. PackedVaryings vert(Attributes input)
  2. {
  3. Varyings output = (Varyings)0;
  4. output = BuildVaryings(input);
  5. PackedVaryings packedOutput = PackVaryings(output);
  6. return packedOutput;
  7. }
  8. half4 frag(PackedVaryings packedInput) : SV_TARGET
  9. {
  10. Varyings unpacked = UnpackVaryings(packedInput);
  11. UNITY_SETUP_INSTANCE_ID(unpacked);
  12. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(unpacked);
  13. SurfaceDescriptionInputs surfaceDescriptionInputs = BuildSurfaceDescriptionInputs(unpacked);
  14. SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
  15. #if _AlphaClip
  16. clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold);
  17. #endif
  18. #ifdef _ALPHAPREMULTIPLY_ON
  19. surfaceDescription.Color *= surfaceDescription.Alpha;
  20. #endif
  21. return half4(surfaceDescription.Color, surfaceDescription.Alpha);
  22. }