postprocess scissor fixes #676

This commit is contained in:
Turánszki János
2023-05-14 18:31:51 +02:00
parent e0b9f3a3c1
commit 8a9432b21c
5 changed files with 11 additions and 13 deletions
@@ -32,8 +32,8 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
const uint2 subtile = unflatten2D(subtile_idx, DEPTHOFFIELD_TILESIZE / 2 / POSTPROCESS_BLOCKSIZE);
const uint2 subtile_upperleft = tile * DEPTHOFFIELD_TILESIZE / 2 + subtile * POSTPROCESS_BLOCKSIZE;
const uint2 pixel = subtile_upperleft + unflatten2D(GTid.x, POSTPROCESS_BLOCKSIZE);
if (!GetCamera().is_pixel_inside_scissor(pixel * 2))
const float2 uv = (pixel + 0.5f) * postprocess.resolution_rcp;
if (!GetCamera().is_uv_inside_scissor(uv))
return;
float alpha;
@@ -57,8 +57,6 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
const float center_backgroundWeight = center_presort.g;
const float center_foregroundWeight = center_presort.b;
const float2 uv = (pixel + 0.5f) * postprocess.resolution_rcp;
#ifdef DEPTHOFFIELD_CHEAP
color = center_color;
[unroll(DOF_RING_COUNT)]
+2 -4
View File
@@ -52,8 +52,8 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
const uint2 subtile = unflatten2D(subtile_idx, MOTIONBLUR_TILESIZE / POSTPROCESS_BLOCKSIZE);
const uint2 subtile_upperleft = tile * MOTIONBLUR_TILESIZE + subtile * POSTPROCESS_BLOCKSIZE;
const uint2 pixel = subtile_upperleft + unflatten2D(GTid.x, POSTPROCESS_BLOCKSIZE);
if (!GetCamera().is_pixel_inside_scissor(pixel))
const float2 uv = (pixel + 0.5f) * postprocess.resolution_rcp;
if (!GetCamera().is_uv_inside_scissor(uv))
return;
float4 color;
@@ -69,8 +69,6 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
const float neighborhood_velocity_magnitude = length(neighborhood_velocity);
const float4 center_color = input[pixel];
const float2 uv = (pixel + 0.5f) * postprocess.resolution_rcp;
const float2 center_velocity = texture_velocity.SampleLevel(sampler_point_clamp, uv, 0).xy * strength;
const float center_velocity_magnitude = length(center_velocity);
const float center_depth = texture_lineardepth.SampleLevel(sampler_point_clamp, uv, 0);
+3 -2
View File
@@ -18,14 +18,15 @@ void main(uint Gid : SV_GroupID, uint groupIndex : SV_GroupIndex)
return;
const uint2 GTid = remap_lane_8x8(groupIndex);
const uint2 pixel = unpack_pixel(tile.visibility_tile_id) * VISIBILITY_BLOCKSIZE + GTid;
const float2 uv = ((float2) pixel + 0.5) * GetCamera().internal_resolution_rcp;
[branch]
if (!GetCamera().is_pixel_inside_scissor(pixel))
if (!GetCamera().is_uv_inside_scissor(uv))
{
output[pixel] = 0;
return;
}
const float2 uv = ((float2) pixel + 0.5) * GetCamera().internal_resolution_rcp;
const float2 clipspace = uv_to_clipspace(uv);
RayDesc ray = CreateCameraRay(clipspace);
@@ -9,14 +9,15 @@ RWTexture2D<float2> output_velocity : register(u0);
void main(uint2 DTid : SV_DispatchThreadID)
{
uint2 pixel = DTid.xy;
const float2 uv = ((float2)pixel + 0.5) * GetCamera().internal_resolution_rcp;
[branch]
if (!GetCamera().is_pixel_inside_scissor(pixel))
if (!GetCamera().is_uv_inside_scissor(uv))
{
output_velocity[pixel] = 0;
return;
}
const float2 uv = ((float2)pixel + 0.5) * GetCamera().internal_resolution_rcp;
const float2 clipspace = uv_to_clipspace(uv);
RayDesc ray = CreateCameraRay(clipspace);
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wi::version
// minor features, major updates, breaking compatibility changes
const int minor = 71;
// minor bug fixes, alterations, refactors, updates
const int revision = 201;
const int revision = 202;
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);