Browse Source

Merge branch 'master' into fsr2

fsr2
Nico de Poel 3 years ago
parent
commit
0cfce0334e
  1. 1
      Packages/com.unity.postprocessing@3.2.2/CHANGELOG.md
  2. 10
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AmbientOcclusionEditor.cs
  3. 10
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AutoExposureEditor.cs
  4. 24
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Utils/EditorUtilities.cs
  5. 1
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AmbientOcclusion.cs
  6. 1
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AutoExposure.cs
  7. 1
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Monitors/Monitor.cs
  8. 15
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs

1
Packages/com.unity.postprocessing@3.2.2/CHANGELOG.md

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
- Fixed obsolete FormatUsage bug
- Disabled compute based effects not supported on WebGL and Android OpenGL
## [3.3.0] - 2023-05-11

10
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AmbientOcclusionEditor.cs

@ -49,8 +49,14 @@ namespace UnityEditor.Rendering.PostProcessing
}
else if (aoMode == (int)AmbientOcclusionMode.MultiScaleVolumetricObscurance)
{
if (!SystemInfo.supportsComputeShaders)
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support.", MessageType.Warning);
if (!SystemInfo.supportsComputeShaders || EditorUtilities.isTargetingWebGL)
{
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support which is not available on this platform.", MessageType.Error);
}
else if(EditorUtilities.isTargetingAndroid)
{
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support (Vulkan) when running on Android.", MessageType.Warning);
}
PropertyField(m_ThicknessModifier);
PropertyField(m_ZBias);

10
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Effects/AutoExposureEditor.cs

@ -31,8 +31,14 @@ namespace UnityEditor.Rendering.PostProcessing
public override void OnInspectorGUI()
{
if (!SystemInfo.supportsComputeShaders)
EditorGUILayout.HelpBox("Auto exposure requires compute shader support.", MessageType.Warning);
if (!SystemInfo.supportsComputeShaders || EditorUtilities.isTargetingWebGL)
{
EditorGUILayout.HelpBox("Auto exposure requires compute shader support which is not available on this platform.", MessageType.Error);
}
else if (EditorUtilities.isTargetingAndroid)
{
EditorGUILayout.HelpBox("Auto exposure requires compute shader support (Vulkan) when running on Android.", MessageType.Warning);
}
EditorUtilities.DrawHeaderLabel("Exposure");

24
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Editor/Utils/EditorUtilities.cs

@ -64,6 +64,30 @@ namespace UnityEditor.Rendering.PostProcessing
}
}
/// <summary>
/// Returns <c>true</c> if the current target is Android, <c>false</c> otherwise.
/// </summary>
public static bool isTargetingAndroid
{
get
{
var t = EditorUserBuildSettings.activeBuildTarget;
return t == BuildTarget.Android;
}
}
/// <summary>
/// Returns <c>true</c> if the current target is WebGL, <c>false</c> otherwise.
/// </summary>
public static bool isTargetingWebGL
{
get
{
var t = EditorUserBuildSettings.activeBuildTarget;
return t == BuildTarget.WebGL;
}
}
/// <summary>
/// Returns <c>true</c> if the current target is a console or a mobile, <c>false</c>
/// otherwise.

1
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AmbientOcclusion.cs

@ -196,6 +196,7 @@ namespace UnityEngine.Rendering.PostProcessing
state &= SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isWebGL
#if UNITY_2023_2_OR_NEWER
&& SystemInfo.IsFormatSupported(GraphicsFormat.R32_SFloat, GraphicsFormatUsage.Render)
&& SystemInfo.IsFormatSupported(GraphicsFormat.R16_SFloat, GraphicsFormatUsage.Render)

1
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/AutoExposure.cs

@ -85,6 +85,7 @@ namespace UnityEngine.Rendering.PostProcessing
return enabled.value
&& SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isWebGL
&& RenderTextureFormat.RFloat.IsSupported()
&& context.resources.computeShaders.autoExposure
&& context.resources.computeShaders.exposureHistogram;

1
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Monitors/Monitor.cs

@ -48,6 +48,7 @@ namespace UnityEngine.Rendering.PostProcessing
return requested
&& SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isWebGL
&& ShaderResourcesAvailable(context);
}

15
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Utils/RuntimeUtilities.cs

@ -858,6 +858,21 @@ namespace UnityEngine.Rendering.PostProcessing
get { return Application.platform == RuntimePlatform.Android && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan; }
}
/// <summary>
/// Returns <c>true</c> if the target platform is WebGL,
/// <c>false</c> otherwise.
/// </summary>
public static bool isWebGL
{
get {
#if UNITY_WEBGL
return true;
#else
return false;
#endif
}
}
/// <summary>
/// Gets the default HDR render texture format for the current target platform.
/// </summary>

Loading…
Cancel
Save