Browse Source

Fixed a few cases of stupid, so that the RTHandle scale now actually works as it should.

master
Nico de Poel 2 years ago
parent
commit
617cbe8472
  1. 8
      com.unity.render-pipelines.high-definition/Runtime/FidelityFX/shaders/cacao/ffx_cacao_callbacks_hlsl.h

8
com.unity.render-pipelines.high-definition/Runtime/FidelityFX/shaders/cacao/ffx_cacao_callbacks_hlsl.h

@ -430,7 +430,7 @@ float4x4 NormalsWorldToViewspaceMatrix(){
#endif #endif
} }
float2 ClampAndScaleUV(float2 UV)
FfxFloat32x2 ClampAndScaleUV_HDRP(FfxFloat32x2 UV)
{ {
#if defined(CACAO_BIND_CB_CACAO) #if defined(CACAO_BIND_CB_CACAO)
return min(UV, 1.0f) * g_FFX_CACAO_RTHandleScale.xy; return min(UV, 1.0f) * g_FFX_CACAO_RTHandleScale.xy;
@ -669,7 +669,7 @@ void FFX_CACAO_Apply_StoreOutput(FfxUInt32x2 coord, FfxFloat32 val)
FfxFloat32x4 FFX_CACAO_Prepare_SampleDepthOffsets(FfxFloat32x2 uv) FfxFloat32x4 FFX_CACAO_Prepare_SampleDepthOffsets(FfxFloat32x2 uv)
{ {
return FFX_CACAO_Prepare_SampleDepthOffsets_Unity(ClampAndScaleUV(uv));
return FFX_CACAO_Prepare_SampleDepthOffsets_Unity(ClampAndScaleUV_HDRP(uv));
// #if defined CACAO_BIND_SRV_DEPTH_IN // #if defined CACAO_BIND_SRV_DEPTH_IN
// FfxFloat32x4 samples; // FfxFloat32x4 samples;
// samples.x = g_DepthIn.SampleLevel(g_PointClampSampler, uv, 0.0f, FfxInt32x2(0, 2)); // samples.x = g_DepthIn.SampleLevel(g_PointClampSampler, uv, 0.0f, FfxInt32x2(0, 2));
@ -684,7 +684,7 @@ FfxFloat32x4 FFX_CACAO_Prepare_SampleDepthOffsets(FfxFloat32x2 uv)
FfxFloat32x4 FFX_CACAO_Prepare_GatherDepth(FfxFloat32x2 uv) FfxFloat32x4 FFX_CACAO_Prepare_GatherDepth(FfxFloat32x2 uv)
{ {
return FFX_CACAO_Prepare_GatherDepth_Unity(uv);
return FFX_CACAO_Prepare_GatherDepth_Unity(ClampAndScaleUV_HDRP(uv));
// #if defined CACAO_BIND_SRV_DEPTH_IN // #if defined CACAO_BIND_SRV_DEPTH_IN
// return g_DepthIn.GatherRed(g_PointClampSampler, uv); // return g_DepthIn.GatherRed(g_PointClampSampler, uv);
// #else // #else
@ -714,7 +714,7 @@ FfxFloat32 FFX_CACAO_Prepare_LoadDepthOffset(FfxUInt32x2 coord, FfxInt32x2 offse
FfxFloat32x4 FFX_CACAO_Prepare_GatherDepthOffset(FfxFloat32x2 uv, FfxInt32x2 offset) FfxFloat32x4 FFX_CACAO_Prepare_GatherDepthOffset(FfxFloat32x2 uv, FfxInt32x2 offset)
{ {
return FFX_CACAO_Prepare_GatherDepthOffset_Unity(ClampAndScaleUV(uv), offset);
return FFX_CACAO_Prepare_GatherDepthOffset_Unity(ClampAndScaleUV_HDRP(uv), offset);
// #if defined CACAO_BIND_SRV_DEPTH_IN // #if defined CACAO_BIND_SRV_DEPTH_IN
// return g_DepthIn.GatherRed(g_PointClampSampler, uv, offset); // return g_DepthIn.GatherRed(g_PointClampSampler, uv, offset);
// #else // #else

Loading…
Cancel
Save