Lux URP Glass Inputs.hlsl 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #ifndef INPUT_LUXLWRP_BASE_INCLUDED
  2. #define INPUT_LUXLWRP_BASE_INCLUDED
  3. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  4. // defines a bunch of helper functions (like lerpwhiteto)
  5. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
  6. // defines SurfaceData, textures and the functions Alpha, SampleAlbedoAlpha, SampleNormal, SampleEmission
  7. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl"
  8. // defines e.g. "DECLARE_LIGHTMAP_OR_SH"
  9. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  10. #include "../Includes/Lux URP Transparent Lighting.hlsl"
  11. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  12. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
  13. // Material Inputs
  14. CBUFFER_START(UnityPerMaterial)
  15. half _FinalAlpha;
  16. //half3 _GlassTint;
  17. //float _RayLength;
  18. float _IOR;
  19. half _BumpRefraction;
  20. float _IsThinShell;
  21. //float _PixelDepth;
  22. half4 _BaseColor;
  23. half _Smoothness;
  24. //half _Metallic;
  25. half4 _SpecColor;
  26. float _ScreenEdgeFade;
  27. // None glass
  28. half _SmoothnessBase;
  29. half4 _SpecColorBase;
  30. //half _Cutoff;
  31. //half _ShadowOffset;
  32. // Needed by LitMetaPass
  33. float4 _BaseMap_ST;
  34. float4 _BumpMap_ST;
  35. half _BumpScale;
  36. float4 _MaskMap_ST;
  37. //half _Occlusion;
  38. //half _TranslucencyPower;
  39. //half _TranslucencyStrength;
  40. //half _ShadowStrength;
  41. //half _Distortion;
  42. half4 _RimColor;
  43. half _RimPower;
  44. half _RimMinPower;
  45. half _RimFrequency;
  46. half _RimPerPositionFrequency;
  47. CBUFFER_END
  48. // Additional textures
  49. TEXTURE2D_X(_CameraOpaqueTexture); SAMPLER(sampler_LinearClamp);
  50. float4 _CameraOpaqueTexture_TexelSize;
  51. SamplerState my_linear_clamp_sampler;
  52. #if defined(SHADER_API_GLES)
  53. TEXTURE2D(_CameraDepthTexture); SAMPLER(sampler_CameraDepthTexture);
  54. #else
  55. TEXTURE2D_X(_CameraDepthTexture); //SAMPLER(sampler_PointClamp);
  56. #endif
  57. float4 _CameraDepthTexture_TexelSize;
  58. #if defined(_MASKMAP)
  59. TEXTURE2D(_MaskMap); SAMPLER(sampler_MaskMap);
  60. #endif
  61. #if defined(_TINTMAP)
  62. TEXTURE2D(_TintMap); SAMPLER(sampler_TintMap);
  63. #endif
  64. // Global Inputs
  65. // Structs
  66. struct VertexInput
  67. {
  68. float3 positionOS : POSITION;
  69. float3 normalOS : NORMAL;
  70. float4 tangentOS : TANGENT;
  71. float2 texcoord : TEXCOORD0;
  72. float2 lightmapUV : TEXCOORD1;
  73. // half4 color : COLOR;
  74. UNITY_VERTEX_INPUT_INSTANCE_ID
  75. };
  76. struct VertexOutput
  77. {
  78. float4 positionCS : SV_POSITION;
  79. float2 uv : TEXCOORD0;
  80. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  81. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 1);
  82. //#ifdef _ADDITIONAL_LIGHTS
  83. float3 positionWS : TEXCOORD2;
  84. //#endif
  85. float3 normalWS : TEXCOORD3;
  86. float3 viewDirWS : TEXCOORD4;
  87. #if defined(_NORMALMAP)
  88. float4 tangentWS : TEXCOORD5;
  89. #endif
  90. half4 fogFactorAndVertexLight : TEXCOORD6;
  91. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  92. float4 shadowCoord : TEXCOORD7;
  93. #endif
  94. float4 projectionCoord : TEXCOORD8;
  95. float scale : TEXCOORD9;
  96. #endif
  97. UNITY_VERTEX_INPUT_INSTANCE_ID
  98. UNITY_VERTEX_OUTPUT_STEREO
  99. };
  100. struct SurfaceDescription
  101. {
  102. half3 albedo;
  103. half alpha;
  104. half3 normalTS;
  105. half3 emission;
  106. half metallic;
  107. half3 specular;
  108. half smoothness;
  109. half occlusion;
  110. };
  111. #endif