Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DepthOnlyPass.hlsl 874B

12345678910111213141516171819202122232425262728293031
  1. #ifndef SG_DEPTH_ONLY_PASS_INCLUDED
  2. #define SG_DEPTH_ONLY_PASS_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. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(unpacked);
  16. SurfaceDescription surfaceDescription = BuildSurfaceDescription(unpacked);
  17. #if defined(_ALPHATEST_ON)
  18. clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold);
  19. #endif
  20. #if defined(LOD_FADE_CROSSFADE) && USE_UNITY_CROSSFADE
  21. LODFadeCrossFade(unpacked.positionCS);
  22. #endif
  23. return packedInput.positionCS.z;
  24. }
  25. #endif