7 changed files with 69 additions and 155 deletions
-
19Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/2_pass_cs/sgsr2_convert.compute
-
40Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/2_pass_cs/sgsr2_upscale.compute
-
41Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/3_pass_cs/sgsr2_activate.compute
-
26Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/3_pass_cs/sgsr2_convert.compute
-
40Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/3_pass_cs/sgsr2_upscale.compute
-
55Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_common.hlsl
-
3Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_common.hlsl.meta
@ -0,0 +1,55 @@ |
|||||
|
#define EPSILON 1.192e-07f |
||||
|
|
||||
|
cbuffer Params : register(b0) |
||||
|
{ |
||||
|
uint2 renderSize; |
||||
|
uint2 displaySize; |
||||
|
float2 renderSizeRcp; |
||||
|
float2 displaySizeRcp; |
||||
|
float2 jitterOffset; |
||||
|
float2 padding1; |
||||
|
float4 clipToPrevClip[4]; |
||||
|
float preExposure; |
||||
|
float cameraFovAngleHor; |
||||
|
float cameraNear; |
||||
|
float MinLerpContribution; |
||||
|
uint bSameCamera; |
||||
|
uint reset; |
||||
|
}; |
||||
|
|
||||
|
float FastLanczos(float base) |
||||
|
{ |
||||
|
float y = base - 1.0f; |
||||
|
float y2 = y * y; |
||||
|
float y_temp = 0.75f * y + y2; |
||||
|
return y_temp * y2; |
||||
|
} |
||||
|
|
||||
|
float3 DecodeColor(uint sample32) |
||||
|
{ |
||||
|
uint x11 = sample32 >> 21u; |
||||
|
uint y11 = sample32 & (2047u << 10u); |
||||
|
uint z10 = sample32 & 1023u; |
||||
|
float3 samplecolor; |
||||
|
samplecolor.x = (float(x11) * (1.0 / 2047.5)); |
||||
|
samplecolor.y = (float(y11) * (4.76953602e-7)) - 0.5; |
||||
|
samplecolor.z = (float(z10) * (1.0 / 1023.5)) - 0.5; |
||||
|
|
||||
|
return samplecolor; |
||||
|
} |
||||
|
|
||||
|
float DecodeColorY(uint sample32) |
||||
|
{ |
||||
|
uint x11 = sample32 >> 21u; |
||||
|
return float(x11) * (1.0 / 2047.5); |
||||
|
} |
||||
|
|
||||
|
uint packHalf2x16(float2 value) |
||||
|
{ |
||||
|
return f32tof16(value.x) | (f32tof16(value.y) << 16); |
||||
|
} |
||||
|
|
||||
|
float2 unpackHalf2x16(uint x) |
||||
|
{ |
||||
|
return f16tof32(uint2(x & 0xFFFF, x >> 16)); |
||||
|
} |
||||
@ -0,0 +1,3 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: bff676b8468748078a48f9d10bb7eabd |
||||
|
timeCreated: 1734795662 |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue