Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AmbientOcclusionEditor : VolumeComponentWithQualityEditor
SerializedDataParameter m_Denoise;
SerializedDataParameter m_DenoiserRadius;

public override bool hasAdvancedMode => (m_RayTracing == null || !(HDRenderPipeline.buildPipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue && m_RayTracing.value.boolValue));
public override bool hasAdvancedMode => (m_RayTracing == null || !(HDRenderPipeline.assetSupportsRayTracing && m_RayTracing.overrideState.boolValue && m_RayTracing.value.boolValue));

public override void OnEnable()
{
Expand Down Expand Up @@ -72,15 +72,15 @@ public override void OnInspectorGUI()
return;
}

if (HDRenderPipeline.buildPipelineSupportsRayTracing)
if (HDRenderPipeline.assetSupportsRayTracing)
PropertyField(m_RayTracing, EditorGUIUtility.TrTextContent("Ray Tracing (Preview)", "Enable ray traced ambient occlusion."));

// Shared attributes
PropertyField(m_Intensity, EditorGUIUtility.TrTextContent("Intensity", "Controls the strength of the ambient occlusion effect. Increase this value to produce darker areas."));
PropertyField(m_DirectLightingStrength, EditorGUIUtility.TrTextContent("Direct Lighting Strength", "Controls how much the ambient light affects occlusion."));

// If ray tracing is supported and it is enabled on this volume, display the ray tracing options.
if (HDRenderPipeline.buildPipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue && m_RayTracing.value.boolValue)
if (HDRenderPipeline.assetSupportsRayTracing && m_RayTracing.overrideState.boolValue && m_RayTracing.value.boolValue)
{
PropertyField(m_LayerMask, EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for ambient occlusion."));
base.OnInspectorGUI(); // Quality Setting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ static void DrawShadowMapContent(SerializedHDLight serialized, Editor owner)
EditorGUILayout.Slider(serialized.areaLightShadowCone, HDAdditionalLightData.k_MinAreaLightShadowCone, HDAdditionalLightData.k_MaxAreaLightShadowCone, s_Styles.areaLightShadowCone);
}

if (HDRenderPipeline.buildPipelineSupportsRayTracing && HDRenderPipeline.pipelineSupportsScreenSpaceShadows)
if (HDRenderPipeline.assetSupportsRayTracing && HDRenderPipeline.pipelineSupportsScreenSpaceShadows)
{
bool isPunctual = lightType == HDLightType.Point || (lightType == HDLightType.Spot && serialized.spotLightShape.GetEnumValue<SpotLightShape>() == SpotLightShape.Cone);
if (isPunctual || (lightType == HDLightType.Area && serialized.areaLightShape == AreaLightShape.Rectangle))
Expand Down Expand Up @@ -1135,7 +1135,7 @@ static void DrawShadowMapContent(SerializedHDLight serialized, Editor owner)
if (lightType == HDLightType.Directional && HDRenderPipeline.pipelineSupportsScreenSpaceShadows)
{
EditorGUILayout.PropertyField(serialized.useScreenSpaceShadows, s_Styles.useScreenSpaceShadows);
if (HDRenderPipeline.buildPipelineSupportsRayTracing)
if (HDRenderPipeline.assetSupportsRayTracing)
{
using (new EditorGUI.DisabledScope(!serialized.useScreenSpaceShadows.boolValue))
{
Expand Down Expand Up @@ -1245,7 +1245,7 @@ static void DrawContactShadowsContent(SerializedHDLight serialized, Editor owner
HDAdditionalLightData.ScalableSettings.UseContactShadow(hdrp),
hdrp.name
);
if (HDRenderPipeline.buildPipelineSupportsRayTracing
if (HDRenderPipeline.assetSupportsRayTracing
&& serialized.contactShadows.@override.boolValue)
{
EditorGUI.indentLevel++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public override void OnInspectorGUI()
PropertyField(m_Enable, EditorGUIUtility.TrTextContent("Enable"));

// The ray tracing enabling checkbox is only displayed if the asset supports ray tracing
bool rayTracingSupported = HDRenderPipeline.buildPipelineSupportsRayTracing;
bool rayTracingSupported = HDRenderPipeline.assetSupportsRayTracing;
if (rayTracingSupported)
PropertyField(m_RayTracing, k_RayTracingText);

Expand Down Expand Up @@ -232,7 +232,7 @@ public override QualitySettingsBlob SaveCustomQualitySettingsAsObject(QualitySet
settings = new QualitySettingsBlob();

// RTR
if (HDRenderPipeline.buildPipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
if (HDRenderPipeline.assetSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
m_RayTracing.value.boolValue)
{
settings.Save<float>(m_MinSmoothness);
Expand All @@ -254,7 +254,7 @@ public override QualitySettingsBlob SaveCustomQualitySettingsAsObject(QualitySet
public override void LoadSettingsFromObject(QualitySettingsBlob settings)
{
// RTR
if (HDRenderPipeline.buildPipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
if (HDRenderPipeline.assetSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
m_RayTracing.value.boolValue)
{
settings.TryLoad<float>(ref m_MinSmoothness);
Expand All @@ -274,7 +274,7 @@ public override void LoadSettingsFromObject(QualitySettingsBlob settings)
public override void LoadSettingsFromQualityPreset(RenderPipelineSettings settings, int level)
{
// RTR
if (HDRenderPipeline.buildPipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
if (HDRenderPipeline.assetSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
m_RayTracing.value.boolValue)
{
CopySetting(ref m_MinSmoothness, settings.lightingQualitySettings.RTRMinSmoothness[level]);
Expand All @@ -294,7 +294,7 @@ public override void LoadSettingsFromQualityPreset(RenderPipelineSettings settin
public override bool QualityEnabled()
{
// Quality always used for SSR
if (!HDRenderPipeline.buildTargetSupportsRayTracing || !m_RayTracing.value.boolValue)
if (!HDRenderPipeline.assetSupportsRayTracing || !m_RayTracing.value.boolValue)
return true;

// Handle the quality usage for RTGI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override void OnInspectorGUI()
}

// If ray tracing is supported display the content of the volume component
if (HDRenderPipeline.buildPipelineSupportsRayTracing)
if (HDRenderPipeline.assetSupportsRayTracing)
{
PropertyField(m_Enable);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public override void OnInspectorGUI()
PropertyField(m_Enable);

// If ray tracing is supported display the content of the volume component
if (HDRenderPipeline.buildPipelineSupportsRayTracing)
if (HDRenderPipeline.assetSupportsRayTracing)
{
PropertyField(m_RayTracing, EditorGUIUtility.TrTextContent("Ray Tracing (Preview)", "Enable ray traced global illumination."));
}
Expand All @@ -113,7 +113,7 @@ public override void OnInspectorGUI()

using (new HDEditorUtils.IndentScope())
{
if (HDRenderPipeline.buildPipelineSupportsRayTracing)
if (HDRenderPipeline.assetSupportsRayTracing)
{
if (m_RayTracing.overrideState.boolValue && m_RayTracing.value.boolValue)
{
Expand Down Expand Up @@ -268,7 +268,7 @@ public override void LoadSettingsFromQualityPreset(RenderPipelineSettings settin
public override bool QualityEnabled()
{
// Quality always used for SSGI
if (!HDRenderPipeline.buildTargetSupportsRayTracing || !m_RayTracing.value.boolValue)
if (!HDRenderPipeline.assetSupportsRayTracing || !m_RayTracing.value.boolValue)
return true;

// Handle the quality usage for RTGI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override void OnInspectorGUI()
}

// If ray tracing is supported display the content of the volume component
if (HDRenderPipeline.buildPipelineSupportsRayTracing)
if (HDRenderPipeline.assetSupportsRayTracing)
{
PropertyField(m_Enable);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal static HDRenderPipeline currentPipeline

internal static bool pipelineSupportsRayTracing => HDRenderPipeline.currentPipeline != null && HDRenderPipeline.currentPipeline.rayTracingSupported;
#if UNITY_EDITOR
internal static bool buildPipelineSupportsRayTracing => HDRenderPipeline.currentPipeline != null && (HDRenderPipeline.currentPipeline.m_AssetSupportsRayTracing && HDRenderPipeline.buildTargetSupportsRayTracing);
internal static bool assetSupportsRayTracing => HDRenderPipeline.currentPipeline != null && (HDRenderPipeline.currentPipeline.m_AssetSupportsRayTracing);
#endif

internal static bool pipelineSupportsScreenSpaceShadows => GraphicsSettings.currentRenderPipeline is HDRenderPipelineAsset hdrpAsset ? hdrpAsset.currentPlatformRenderPipelineSettings.hdShadowInitParams.supportScreenSpaceShadows : false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,13 @@ internal HDRaytracingLightCluster RequestLightCluster()
static internal bool PipelineSupportsRayTracing(RenderPipelineSettings rpSetting)
=> rpSetting.supportRayTracing && currentSystemSupportsRayTracing;

static internal bool currentSystemSupportsRayTracing
=> SystemInfo.supportsRayTracing;

static internal bool currentSystemSupportsRayTracing => SystemInfo.supportsRayTracing
#if UNITY_EDITOR
static internal bool buildTargetSupportsRayTracing
=> (UnityEditor.PlayerSettings.GetGraphicsAPIs(UnityEditor.EditorUserBuildSettings.activeBuildTarget)[0] == GraphicsDeviceType.Direct3D12)
|| (UnityEditor.PlayerSettings.GetGraphicsAPIs(UnityEditor.EditorUserBuildSettings.activeBuildTarget)[0] == GraphicsDeviceType.PlayStation5);
&& ((UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows64
|| UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows)
|| UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.PS5);
#else
;
#endif

internal BlueNoise GetBlueNoiseManager()
Expand Down