From 05989857c0dc54b326b8f05005eb1fa12a7e8a52 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Sun, 22 Dec 2024 13:42:14 +0100 Subject: [PATCH] Added an untested and as of yet unused HDRP include file, just as an expression of what this file will look like for SRPs --- .../Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl | 18 ++++++++++++++++++ .../SGSR2/Shaders/sgsr2_hdrp.hlsl.meta | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl create mode 100644 Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl.meta diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl new file mode 100644 index 0000000..e0531ab --- /dev/null +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl @@ -0,0 +1,18 @@ +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + +// Using renderSizeRcp here is a bit of a hack, but the SRPs don't offer any macros for gather with offset, and we know which texture the GatherBlue will be used for +#define GATHER_BLUE_TEXTURE2D_X_OFFSET(textureName, samplerName, coord2, offset) GATHER_BLUE_TEXTURE2D_X(textureName, samplerName, coord2 + offset * renderSizeRcp) + +#define S_POINT_CLAMP s_point_clamp_sampler +#define S_LINEAR_CLAMP s_linear_clamp_sampler + +inline float2 decodeVelocityFromTexture(float2 ev) +{ + // Nothing much to do, motion vectors are not encoded +#if UNITY_UV_STARTS_AT_TOP + return -ev; +#else + return ev; +#endif +} diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl.meta b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl.meta new file mode 100644 index 0000000..82f81ea --- /dev/null +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_hdrp.hlsl.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ae8ec449c111471fb8eecbd6142cb9ad +timeCreated: 1734870531 \ No newline at end of file