EnviroBlitTroughHDRP.shader 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Shader "Hidden/Enviro/BlitTroughHDRP"
  2. {
  3. HLSLINCLUDE
  4. #pragma target 4.5
  5. #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch
  6. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  7. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  8. #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
  9. #include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FXAA.hlsl"
  10. #include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/RTUpscale.hlsl"
  11. struct Attributes
  12. {
  13. uint vertexID : SV_VertexID;
  14. UNITY_VERTEX_INPUT_INSTANCE_ID
  15. };
  16. struct Varyings
  17. {
  18. float4 positionCS : SV_POSITION;
  19. float2 texcoord : TEXCOORD0;
  20. UNITY_VERTEX_OUTPUT_STEREO
  21. };
  22. Varyings Vert(Attributes input)
  23. {
  24. Varyings output;
  25. UNITY_SETUP_INSTANCE_ID(input);
  26. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  27. output.positionCS = GetFullScreenTriangleVertexPosition(input.vertexID);
  28. output.texcoord = GetFullScreenTriangleTexCoord(input.vertexID);
  29. return output;
  30. }
  31. // List of properties to control your post process effect
  32. float _Intensity;
  33. TEXTURE2D_X(_InputTexture);
  34. float4 CustomPostProcess(Varyings input) : SV_Target
  35. {
  36. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  37. uint2 positionSS = input.texcoord * _ScreenSize.xy;
  38. float3 outColor = LOAD_TEXTURE2D_X(_InputTexture, positionSS).xyz;
  39. return float4(outColor, 1);
  40. }
  41. ENDHLSL
  42. SubShader
  43. {
  44. Tags{ "RenderPipeline" = "HDRenderPipeline" }
  45. Pass
  46. {
  47. Name "EnviroBlitTroughHDRP"
  48. ZWrite Off
  49. ZTest Always
  50. Blend Off
  51. Cull Off
  52. HLSLPROGRAM
  53. #pragma fragment CustomPostProcess
  54. #pragma vertex Vert
  55. ENDHLSL
  56. }
  57. }
  58. Fallback Off
  59. }