Skip to content

Commit

Permalink
[HDRP] Fix custom pass volume not executed in scene view (#4860)
Browse files Browse the repository at this point in the history
* Fix custom pass volume not executed in scene view because of the volume culling mask

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
  • Loading branch information
alelievr and sebastienlagarde committed Jun 16, 2021
1 parent df51161 commit 2bc152b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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 @@ -260,6 +260,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed the shader graph files that was still dirty after the first save (case 1342039).
- Fixed cases in which object and camera motion vectors would cancel out, but didn't.
- Fixed HDRP material upgrade failing when there is a texture inside the builtin resources assigned in the material (case 1339865).
- Fixed custom pass volume not executed in scene view because of the volume culling mask.

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ bool IsVisible(HDCamera hdCamera)
#endif

// We never execute volume if the layer is not within the culling layers of the camera
if ((hdCamera.volumeLayerMask & (1 << gameObject.layer)) == 0)
// Special case for the scene view: we can't easily change it's volume later mask, so by default we show all custom passes
if (hdCamera.camera.cameraType != CameraType.SceneView && (hdCamera.volumeLayerMask & (1 << gameObject.layer)) == 0)
return false;

return true;
Expand Down Expand Up @@ -171,8 +172,7 @@ internal static void Update(HDCamera camera)
// Traverse all volumes
foreach (var volume in m_ActivePassVolumes)
{
// Ignore volumes that are not in the camera layer mask
if ((camera.volumeLayerMask & (1 << volume.gameObject.layer)) == 0)
if (!volume.IsVisible(camera))
continue;

// Global volumes always have influence
Expand Down

0 comments on commit 2bc152b

Please sign in to comment.