Skip to content

Fix render queue migration to 10.x #2198

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 2 commits into from
Oct 13, 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 @@ -159,6 +159,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed profiling scope for quality RTGI.
- Fixed the denoising and multi-sample not being used for smooth multibounce RTReflections.
- Fixed after post process rendering pass options not showing for unlit ShaderGraphs.
- Fixed a migration issue with the rendering queue in ShaderGraph when upgrading to 10.x;

### Changed
- Preparation pass for RTSSShadows to be supported by render graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void UpgradeHDLitMasterNode(HDLitMasterNode1 hdLitMasterNode, out Dictionary<Blo
// Set data
systemData.surfaceType = (SurfaceType)hdLitMasterNode.m_SurfaceType;
systemData.blendMode = HDSubShaderUtilities.UpgradeLegacyAlphaModeToBlendMode((int)hdLitMasterNode.m_AlphaMode);
systemData.renderingPass = hdLitMasterNode.m_RenderingPass;
systemData.renderingPass = HDRenderQueue.MigrateRenderQueueToHDRP10(hdLitMasterNode.m_RenderingPass);
// Patch rendering pass in case the master node had an old configuration
if (systemData.renderingPass == HDRenderQueue.RenderQueueType.Background)
systemData.renderingPass = HDRenderQueue.RenderQueueType.Opaque;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void UpgradeHDUnlitMasterNode(HDUnlitMasterNode1 hdUnlitMasterNode, out Dictiona
// Set data
systemData.surfaceType = (SurfaceType)hdUnlitMasterNode.m_SurfaceType;
systemData.blendMode = HDSubShaderUtilities.UpgradeLegacyAlphaModeToBlendMode((int)hdUnlitMasterNode.m_AlphaMode);
systemData.renderingPass = hdUnlitMasterNode.m_RenderingPass;
systemData.renderingPass = HDRenderQueue.MigrateRenderQueueToHDRP10(hdUnlitMasterNode.m_RenderingPass);
// Patch rendering pass in case the master node had an old configuration
if (systemData.renderingPass == HDRenderQueue.RenderQueueType.Background)
systemData.renderingPass = HDRenderQueue.RenderQueueType.Opaque;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ public enum RenderQueueType
Unknown
}

internal static RenderQueueType MigrateRenderQueueToHDRP10(RenderQueueType renderQueue)
{
switch((int)renderQueue)
{
case 0: return RenderQueueType.Background; // Background
case 1: return RenderQueueType.Opaque; // Opaque
case 2: return RenderQueueType.AfterPostProcessOpaque; // AfterPostProcessOpaque
case 3: return RenderQueueType.Opaque; // RaytracingOpaque
case 4: return RenderQueueType.PreRefraction; // PreRefraction
case 5: return RenderQueueType.Transparent; // Transparent
case 6: return RenderQueueType.LowTransparent; // LowTransparent
case 7: return RenderQueueType.AfterPostprocessTransparent; // AfterPostprocessTransparent
case 8: return RenderQueueType.Transparent; // RaytracingTransparent
case 9: return RenderQueueType.Overlay; // Overlay
default:
case 10: return RenderQueueType.Unknown; // Unknown
}
}

public static readonly RenderQueueRange k_RenderQueue_OpaqueNoAlphaTest = new RenderQueueRange { lowerBound = (int)Priority.Background, upperBound = (int)Priority.OpaqueAlphaTest - 1 };
public static readonly RenderQueueRange k_RenderQueue_OpaqueAlphaTest = new RenderQueueRange { lowerBound = (int)Priority.OpaqueAlphaTest, upperBound = (int)Priority.OpaqueLast };
public static readonly RenderQueueRange k_RenderQueue_OpaqueDecalAndAlphaTest = new RenderQueueRange { lowerBound = (int)Priority.OpaqueDecal, upperBound = (int)Priority.OpaqueLast };
Expand Down