Skip to content

Fixed a regression in the ray traced indirect diffuse due to the new probe system. #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down