ShaderDefines.cginc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // UNITY_SHADER_NO_UPGRADE
  2. #ifndef _VLB_SHADER_DEFINES_INCLUDED_
  3. #define _VLB_SHADER_DEFINES_INCLUDED_
  4. /// ****************************************
  5. /// GLOBAL DEFINES
  6. /// ****************************************
  7. #if UNITY_VERSION < 201810 // SRP support introduced in Unity 2018.1.0
  8. #undef VLB_SRP_API
  9. #endif
  10. #if UNITY_VERSION >= 560 // Instancing API introduced in Unity 5.6
  11. #define VLB_INSTANCING_API_AVAILABLE 1
  12. #if defined(INSTANCING_ON)
  13. #define VLB_GPU_INSTANCING 1
  14. #endif
  15. #endif
  16. #if UNITY_VERSION >= 550 // Single Pass Instanced rendering introduced in Unity 5.5
  17. #define VLB_STEREO_INSTANCING 1
  18. #endif
  19. #if VLB_SRP_API && VLB_INSTANCING_API_AVAILABLE && VLB_GPU_INSTANCING
  20. // When using SRP API and GPU Instancing, the unity_WorldToObject and unity_ObjectToWorld matrices are not sent, so we have to manually send them
  21. #define VLB_CUSTOM_INSTANCED_OBJECT_MATRICES 1
  22. #endif
  23. /// ****************************************
  24. /// ****************************************
  25. /// DEBUG
  26. /// ****************************************
  27. #define DEBUG_VALUE_DEPTHBUFFER 1
  28. #define DEBUG_VALUE_DEPTHBLEND 2
  29. #define DEBUG_VALUE_DEPTHSTEREOEYE 3
  30. //#define DEBUG_DEPTH_MODE DEBUG_VALUE_DEPTHBUFFER
  31. //#define DEBUG_SHOW_NOISE3D 1
  32. //#define DEBUG_BLEND_INSIDE_OUTSIDE 1
  33. #if DEBUG_DEPTH_MODE && !VLB_DEPTH_BLEND
  34. #define VLB_DEPTH_BLEND 1
  35. #endif
  36. #if DEBUG_SHOW_NOISE3D && !VLB_NOISE_3D
  37. #define VLB_NOISE_3D 1
  38. #endif
  39. /// ****************************************
  40. /// ****************************************
  41. /// OPTIM
  42. /// ****************************************
  43. /// compute most of the intensity in VS => huge perf improvements
  44. #if !VLB_SHADER_ACCURACY_HIGH
  45. #define OPTIM_VS 1
  46. #endif
  47. /// when OPTIM_VS is enabled, also compute fresnel in VS => better perf,
  48. /// but require too much tessellation for the same quality
  49. //#define OPTIM_VS_FRESNEL_VS 1
  50. /// ****************************************
  51. /// ****************************************
  52. /// FIXES
  53. /// ****************************************
  54. #define FIX_DISABLE_DEPTH_BLEND_WITH_OBLIQUE_PROJ 1
  55. /// ****************************************
  56. #endif