PBR2DPass.hlsl 847 B

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