Skip to content

Commit 04c6451

Browse files
Fixed using the wrong coordinate to compute the sampling direction for the screen space global illumination. (#6903)
Co-authored-by: sebastienlagarde <[email protected]>
1 parent f1c6afa commit 04c6451

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7878
- Fixed issue where scene list was not refreshed upon deleting an APV baking set.
7979
- Fixed a null ref exception in Volume Explorer
8080
- Fixed one frame flicker on hardware DRS - (case 1398085)
81+
- Fixed using the wrong coordinate to compute the sampling direction for the screen space global illumination.
8182

8283
## [14.0.0] - 2021-11-17
8384

com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.compute

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,21 @@ void REPROJECT_GLOBAL_ILLUMINATION(uint3 dispatchThreadId : SV_DispatchThreadID,
199199
UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z);
200200

201201
// Compute the pixel position to process
202-
uint2 currentCoord = groupId * INDIRECT_DIFFUSE_TILE_SIZE + groupThreadId;
203-
202+
uint2 inputCoord = dispatchThreadId.xy;
203+
uint2 currentCoord = dispatchThreadId.xy;
204204
#if HALF_RES
205205
// Compute the full resolution pixel for the inputs that do not have a pyramid
206-
currentCoord = currentCoord * 2;
206+
inputCoord = inputCoord * 2;
207207
#endif
208208

209209
// Read the depth and compute the position
210-
float deviceDepth = LOAD_TEXTURE2D_X(_DepthTexture, currentCoord).x;
211-
uint2 tileIndex = uint2(currentCoord) / GetTileSize();
212-
PositionInputs posInput = GetPositionInput(currentCoord, _ScreenSize.zw, deviceDepth, UNITY_MATRIX_I_VP, GetWorldToViewMatrix(), tileIndex);
210+
float deviceDepth = LOAD_TEXTURE2D_X(_DepthTexture, inputCoord).x;
211+
uint2 tileIndex = uint2(inputCoord) / GetTileSize();
212+
PositionInputs posInput = GetPositionInput(inputCoord, _ScreenSize.zw, deviceDepth, UNITY_MATRIX_I_VP, GetWorldToViewMatrix(), tileIndex);
213213

214214
// Read the pixel normal
215215
NormalData normalData;
216-
DecodeFromNormalBuffer(currentCoord.xy, normalData);
216+
DecodeFromNormalBuffer(inputCoord.xy, normalData);
217217

218218
// Generete a new direction to follow
219219
float2 newSample;
@@ -308,5 +308,5 @@ void REPROJECT_GLOBAL_ILLUMINATION(uint3 dispatchThreadId : SV_DispatchThreadID,
308308
color = HsvToRgb(color);
309309

310310
// Write the output to the target pixel
311-
_IndirectDiffuseTextureRW[COORD_TEXTURE2D_X(dispatchThreadId.xy)] = color;
311+
_IndirectDiffuseTextureRW[COORD_TEXTURE2D_X(currentCoord)] = color;
312312
}

0 commit comments

Comments
 (0)