minor updates

This commit is contained in:
turanszkij
2020-03-18 19:51:05 +00:00
parent ff79e16cfe
commit 811a8286a9
6 changed files with 15 additions and 14 deletions
+2 -2
View File
@@ -161,7 +161,7 @@ void RenderPath3D::ResizeBuffers()
{
TextureDesc desc;
desc.BindFlags = BIND_SHADER_RESOURCE | BIND_UNORDERED_ACCESS;
desc.Format = FORMAT_R16G16B16A16_FLOAT;
desc.Format = FORMAT_R11G11B10_FLOAT;
desc.Width = wiRenderer::GetInternalResolution().x;
desc.Height = wiRenderer::GetInternalResolution().y;
device->CreateTexture(&desc, nullptr, &rtTemporalAA[0]);
@@ -172,7 +172,7 @@ void RenderPath3D::ResizeBuffers()
{
TextureDesc desc;
desc.BindFlags = BIND_RENDER_TARGET | BIND_SHADER_RESOURCE | BIND_UNORDERED_ACCESS;
desc.Format = FORMAT_R16G16B16A16_FLOAT;
desc.Format = FORMAT_R11G11B10_FLOAT;
desc.Width = wiRenderer::GetInternalResolution().x;
desc.Height = wiRenderer::GetInternalResolution().y;
device->CreateTexture(&desc, nullptr, &rtPostprocess_HDR);
+4 -4
View File
@@ -67,8 +67,8 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
for (uint i = ringSampleCount[j]; i < ringSampleCount[j + 1]; ++i)
{
const float offsetCoc = disc[i].z;
const float2 uv2 = uv + ringScale * disc[i].xy * (1 + rand(seed, uv) * 0.15);
color += texture_prefilter.SampleLevel(sampler_point_clamp, uv2, 0);
const float2 uv2 = uv + ringScale * disc[i].xy;
color += texture_prefilter.SampleLevel(sampler_linear_clamp, uv2, 0);
}
}
color *= ringNormFactor[ringCount];
@@ -84,8 +84,8 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
for (uint i = ringSampleCount[j]; i < ringSampleCount[j + 1]; ++i)
{
const float offsetCoc = disc[i].z;
const float2 uv2 = uv + ringScale * disc[i].xy * (1 + rand(seed, uv) * 0.15);
const float4 color = float4(texture_prefilter.SampleLevel(sampler_point_clamp, uv2, 0), 1);
const float2 uv2 = uv + ringScale * disc[i].xy;
const float4 color = float4(texture_prefilter.SampleLevel(sampler_linear_clamp, uv2, 0), 1);
const float3 presort = texture_presort.SampleLevel(sampler_point_clamp, uv2, 0).rgb;
const float coc = presort.r;
const float spreadCmp = SpreadCmp(offsetCoc, coc, spreadScale);
+3 -3
View File
@@ -50,14 +50,14 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
{
float seed = 54321;
const float2 ringScale = 2 * coc * float2(max(1, dof_aspect), max(1, 2 - dof_aspect)) * xPPResolution_rcp;
const float2 ringScale = 0.5f * coc * float2(max(1, dof_aspect), max(1, 2 - dof_aspect)) * xPPResolution_rcp;
[unroll]
for (uint i = ringSampleCount[0]; i < ringSampleCount[1]; ++i)
{
const float offsetCoc = disc[i].z;
const float2 uv2 = uv + ringScale * disc[i].xy * (1 + rand(seed, uv) * 0.1);
const float2 uv2 = uv + ringScale * disc[i].xy;
const float depth = texture_lineardepth_minmax.SampleLevel(sampler_point_clamp, uv2, 0).g;
const float3 color = max(0, input.SampleLevel(sampler_point_clamp, uv2, 0).rgb);
const float3 color = max(0, input.SampleLevel(sampler_linear_clamp, uv2, 0).rgb);
const float weight = saturate(abs(depth - center_depth) * g_xCamera_ZFarP * 2);
prefilter += lerp(color, center_color, weight);
}
+4 -4
View File
@@ -1,10 +1,10 @@
#include "globals.hlsli"
#include "ShaderInterop_Postprocess.h"
TEXTURE2D(input_current, float4, TEXSLOT_ONDEMAND0);
TEXTURE2D(input_history, float4, TEXSLOT_ONDEMAND1);
TEXTURE2D(input_current, float3, TEXSLOT_ONDEMAND0);
TEXTURE2D(input_history, float3, TEXSLOT_ONDEMAND1);
RWTEXTURE2D(output, float4, 0);
RWTEXTURE2D(output, float3, 0);
// Neighborhood load optimization:
#define USE_LDS
@@ -120,7 +120,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint3
#endif
// do the temporal super sampling by linearly accumulating previous samples with the current one:
float4 resolved = float4(lerp(history.rgb, current.rgb, blendfactor), 1);
float3 resolved = lerp(history.rgb, current.rgb, blendfactor);
#ifdef HDR_CORRECTION
resolved.rgb = inverseTonemap(resolved.rgb);
+1
View File
@@ -9721,6 +9721,7 @@ void Postprocess_MotionBlur(
device->Barrier(&GPUBarrier::Memory(), 1, cmd);
device->UnbindUAVs(0, arraysize(uavs), cmd);
device->UnbindResources(TEXSLOT_ONDEMAND0, arraysize(res), cmd);
device->EventEnd(cmd);
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 38;
// minor bug fixes, alterations, refactors, updates
const int revision = 19;
const int revision = 20;
long GetVersion()