Skip to content

Commit f49b710

Browse files
Display Info Box when MSAA + ray tracing is onr (#4627)
* Show info box when ray tracing is enabled. * Changelog * Move below MSAA Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
1 parent 64a6c13 commit f49b710

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
278278
- Global Camera shader constants are now pushed when doing a custom render callback.
279279
- Splited HDProjectSettings with new HDUserSettings in UserProject. Now Wizard working variable should not bother versioning tool anymore (case 1330640)
280280
- Removed redundant Show Inactive Objects and Isolate Selection checkboxes from the Emissive Materials tab of the Light Explorer (case 1331750).
281+
- Display an info box and disable MSAA asset entry when ray tracing is enabled.
281282

282283
## [11.0.0] - 2020-10-21
283284

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public class Styles
147147
public static readonly GUIContent supportedRayTracingMode = EditorGUIUtility.TrTextContent("Supported Ray Tracing Mode (Preview)");
148148
public static readonly GUIContent rayTracingUnsupportedWarning = EditorGUIUtility.TrTextContent("Ray tracing is not supported on your device. Please refer to the documentation.");
149149
public static readonly GUIContent rayTracingDX12OnlyWarning = EditorGUIUtility.TrTextContent("Ray tracing is currently only supported on DX12.");
150+
public static readonly GUIContent rayTracingMSAAUnsupported = EditorGUIUtility.TrTextContent("When Ray tracing is enabled in asset, MSAA is not supported. Please refer to the documentation.");
150151
public static readonly GUIContent maximumLODLevel = EditorGUIUtility.TrTextContent("Maximum LOD Level");
151152
public static readonly GUIContent LODBias = EditorGUIUtility.TrTextContent("LOD Bias");
152153
public static readonly GUIContent supportProbeVolumeContent = EditorGUIUtility.TrTextContent("Enable", "When enabled, HDRP allocates Shader variants and memory for probe volume based GI. This allows you to use probe volumes in your Unity Project.");

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,17 +1138,26 @@ static void Drawer_SectionRenderingUnsorted(SerializedHDRenderPipelineAsset seri
11381138
// MSAA is an option that is only available in full forward but Camera can be set in Full Forward only. Thus MSAA have no dependency currently
11391139
//Note: do not use SerializedProperty.enumValueIndex here as this enum not start at 0 as it is used as flags.
11401140
bool msaaAllowed = true;
1141+
bool hasRayTracing = false;
11411142
for (int index = 0; index < serialized.serializedObject.targetObjects.Length && msaaAllowed; ++index)
11421143
{
1143-
var litShaderMode = (serialized.serializedObject.targetObjects[index] as HDRenderPipelineAsset).currentPlatformRenderPipelineSettings.supportedLitShaderMode;
1144-
msaaAllowed &= litShaderMode == SupportedLitShaderMode.ForwardOnly || litShaderMode == SupportedLitShaderMode.Both;
1144+
var settings = (serialized.serializedObject.targetObjects[index] as HDRenderPipelineAsset).currentPlatformRenderPipelineSettings;
1145+
var litShaderMode = settings.supportedLitShaderMode;
1146+
bool rayTracedSupported = settings.supportRayTracing;
1147+
hasRayTracing |= rayTracedSupported;
1148+
msaaAllowed &= (litShaderMode == SupportedLitShaderMode.ForwardOnly || litShaderMode == SupportedLitShaderMode.Both) && !rayTracedSupported;
11451149
}
1150+
11461151
using (new EditorGUI.DisabledScope(!msaaAllowed))
11471152
{
11481153
++EditorGUI.indentLevel;
11491154
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.MSAASampleCount, Styles.MSAASampleCountContent);
11501155
--EditorGUI.indentLevel;
11511156
}
1157+
if (hasRayTracing && serialized.renderPipelineSettings.MSAASampleCount.intValue != (int)MSAASamples.None)
1158+
{
1159+
EditorGUILayout.HelpBox(Styles.rayTracingMSAAUnsupported.text, MessageType.Info, wide: true);
1160+
}
11521161

11531162
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportMotionVectors, Styles.supportMotionVectorContent);
11541163
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportRuntimeDebugDisplay, Styles.supportRuntimeDebugDisplayContent);

0 commit comments

Comments
 (0)