diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 55481e24e24..66188b58b43 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -511,6 +511,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix issues in the post process system with RenderTexture being invalid in some cases, causing rendering problems. - Fixed an issue where unncessarily serialized members in StaticLightingSky component would change each time the scene is changed. - Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). +- Fixed a regression in the ray traced indirect diffuse due to the new probe system. ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl index aaa59d16f26..65e1815119f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl @@ -38,6 +38,9 @@ void InitBuiltinData(PositionInputs posInput, float alpha, float3 normalWS, floa builtinData.opacity = alpha; + // Use uniform directly - The float need to be cast to uint (as unity don't support to set a uint as uniform) + builtinData.renderingLayers = _EnableLightLayers ? asuint(unity_RenderingLayer.x) : DEFAULT_LIGHT_LAYERS; + // We only want to read the screen space buffer that holds the indirect diffuse signal if this is not a transparent surface #if RAYTRACING_ENABLED && (SHADERPASS == SHADERPASS_GBUFFER || SHADERPASS == SHADERPASS_FORWARD) && !defined(_SURFACE_TYPE_TRANSPARENT) if (_RaytracedIndirectDiffuse == 1) @@ -54,12 +57,11 @@ void InitBuiltinData(PositionInputs posInput, float alpha, float3 normalWS, floa } else #endif + { + // Sample lightmap/probevolume/lightprobe/volume proxy + builtinData.bakeDiffuseLighting = SampleBakedGI(posInput, normalWS, builtinData.renderingLayers, texCoord1.xy, texCoord2.xy); + } - // Use uniform directly - The float need to be cast to uint (as unity don't support to set a uint as uniform) - builtinData.renderingLayers = _EnableLightLayers ? asuint(unity_RenderingLayer.x) : DEFAULT_LIGHT_LAYERS; - - // Sample lightmap/probevolume/lightprobe/volume proxy - builtinData.bakeDiffuseLighting = SampleBakedGI(posInput, normalWS, builtinData.renderingLayers, texCoord1.xy, texCoord2.xy); // We also sample the back lighting in case we have transmission. If not use this will be optimize out by the compiler // For now simply recall the function with inverted normal, the compiler should be able to optimize the lightmap case to not resample the directional lightmap // however it may not optimize the lightprobe case due to the proxy volume relying on dynamic if (to verify), not a problem for SH9, but a problem for proxy volume.