Skip to content

[HDRP] Fix custom pass volume not executed in scene view #4860

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 3 commits into from
Jun 16, 2021
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 @@ -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