|
|
@ -40,6 +40,7 @@ cbuffer Params : register(b0) |
|
|
float2 renderSizeRcp; |
|
|
float2 renderSizeRcp; |
|
|
float2 displaySizeRcp; |
|
|
float2 displaySizeRcp; |
|
|
float2 jitterOffset; |
|
|
float2 jitterOffset; |
|
|
|
|
|
float2 padding1; |
|
|
float4 clipToPrevClip[4]; |
|
|
float4 clipToPrevClip[4]; |
|
|
float preExposure; |
|
|
float preExposure; |
|
|
float cameraFovAngleHor; |
|
|
float cameraFovAngleHor; |
|
|
@ -53,10 +54,8 @@ SamplerState s_PointClamp : register(s0); |
|
|
SamplerState s_LinearClamp : register(s1); |
|
|
SamplerState s_LinearClamp : register(s1); |
|
|
|
|
|
|
|
|
[numthreads(8, 8, 1)] |
|
|
[numthreads(8, 8, 1)] |
|
|
void CS(uint2 GroupId : SV_GroupID, uint2 GroupThreadId : SV_GroupThreadID) |
|
|
|
|
|
|
|
|
void CS(uint3 globalInvocationID : SV_DispatchThreadID) |
|
|
{ |
|
|
{ |
|
|
uint2 InvocationID = GroupId * uint2(8, 8) + GroupThreadId; |
|
|
|
|
|
|
|
|
|
|
|
float Biasmax_viewportXScale = min(float(displaySize.x) / float(renderSize.x), 1.99); //Biasmax_viewportXScale |
|
|
float Biasmax_viewportXScale = min(float(displaySize.x) / float(renderSize.x), 1.99); //Biasmax_viewportXScale |
|
|
float scalefactor = min(20.0, pow((float(displaySize.x) / float(renderSize.x)) * (float(displaySize.y) / float(renderSize.y)), 3.0)); |
|
|
float scalefactor = min(20.0, pow((float(displaySize.x) / float(renderSize.x)) * (float(displaySize.y) / float(renderSize.y)), 3.0)); |
|
|
float f2 = preExposure; //1.0; //preExposure |
|
|
float f2 = preExposure; //1.0; //preExposure |
|
|
@ -64,7 +63,7 @@ void CS(uint2 GroupId : SV_GroupID, uint2 GroupThreadId : SV_GroupThreadID) |
|
|
float2 HistoryInfoViewportSize = float2(displaySize); |
|
|
float2 HistoryInfoViewportSize = float2(displaySize); |
|
|
float2 InputJitter = jitterOffset; |
|
|
float2 InputJitter = jitterOffset; |
|
|
float2 InputInfoViewportSize = float2(renderSize); |
|
|
float2 InputInfoViewportSize = float2(renderSize); |
|
|
float2 Hruv = (float2(InvocationID) + 0.5f) * HistoryInfoViewportSizeInverse; |
|
|
|
|
|
|
|
|
float2 Hruv = (float2(globalInvocationID.xy) + 0.5f) * HistoryInfoViewportSizeInverse; |
|
|
float2 Jitteruv; |
|
|
float2 Jitteruv; |
|
|
Jitteruv.x = clamp(Hruv.x + (InputJitter.x * HistoryInfoViewportSizeInverse.x), 0.0, 1.0); |
|
|
Jitteruv.x = clamp(Hruv.x + (InputJitter.x * HistoryInfoViewportSizeInverse.x), 0.0, 1.0); |
|
|
Jitteruv.y = clamp(Hruv.y + (InputJitter.y * HistoryInfoViewportSizeInverse.y), 0.0, 1.0); |
|
|
Jitteruv.y = clamp(Hruv.y + (InputJitter.y * HistoryInfoViewportSizeInverse.y), 0.0, 1.0); |
|
|
@ -297,7 +296,7 @@ void CS(uint2 GroupId : SV_GroupID, uint2 GroupThreadId : SV_GroupThreadID) |
|
|
float alpha = clamp(Upsampledcw.w / alphasum + float(reset), 0.0, 1.0); |
|
|
float alpha = clamp(Upsampledcw.w / alphasum + float(reset), 0.0, 1.0); |
|
|
Upsampledcw.xyz = lerp(HistoryColor, Upsampledcw.xyz, alpha); |
|
|
Upsampledcw.xyz = lerp(HistoryColor, Upsampledcw.xyz, alpha); |
|
|
|
|
|
|
|
|
HistoryOutput[InvocationID.xy] = float4(Upsampledcw.xyz, Wfactor); |
|
|
|
|
|
|
|
|
HistoryOutput[globalInvocationID.xy] = float4(Upsampledcw.xyz, Wfactor); |
|
|
|
|
|
|
|
|
////ycocg to grb |
|
|
////ycocg to grb |
|
|
float x_z = Upsampledcw.x - Upsampledcw.z; |
|
|
float x_z = Upsampledcw.x - Upsampledcw.z; |
|
|
@ -311,5 +310,5 @@ void CS(uint2 GroupId : SV_GroupID, uint2 GroupThreadId : SV_GroupThreadID) |
|
|
float scale = preExposure / ((1.0f + 1.0f / 65504.0f) - compMax); //(1.0f + 1.0f / 65504.0f) = 1.000015e+00 |
|
|
float scale = preExposure / ((1.0f + 1.0f / 65504.0f) - compMax); //(1.0f + 1.0f / 65504.0f) = 1.000015e+00 |
|
|
|
|
|
|
|
|
Upsampledcw.xyz = Upsampledcw.xyz * scale; |
|
|
Upsampledcw.xyz = Upsampledcw.xyz * scale; |
|
|
SceneColorOutput[InvocationID.xy] = Upsampledcw; |
|
|
|
|
|
|
|
|
SceneColorOutput[globalInvocationID.xy] = Upsampledcw; |
|
|
} |
|
|
} |