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
1 change: 1 addition & 0 deletions com.unity.postprocessing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed
- Remove support for PVRTC format in Unity 6.1 or newer
- Fixed compute based effects not supported on OpenGLES
- Documentation updates

## [3.4.0] - 2023-12-11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ public override void OnInspectorGUI()
{
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support which is not available on this platform.", MessageType.Error);
}
else if (EditorUtilities.isTargetingWebGL)
if (EditorUtilities.isTargetingOpenGLES)
{
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support (WebGPU) when running on Web.", MessageType.Warning);
EditorGUILayout.HelpBox("\"Multi-scale volumetric obscurance requires compute shader support which is not available for OpenGLES.", MessageType.Warning);
}
else if(EditorUtilities.isTargetingAndroid)
else if (EditorUtilities.isTargetingWebGL)
{
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support (Vulkan) when running on Android.", MessageType.Warning);
EditorGUILayout.HelpBox("Multi-scale volumetric obscurance requires compute shader support (WebGPU) when running on Web.", MessageType.Warning);
}

PropertyField(m_ThicknessModifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public override void OnInspectorGUI()
{
EditorGUILayout.HelpBox("Auto exposure requires compute shader support which is not available on this platform.", MessageType.Error);
}
else if (EditorUtilities.isTargetingWebGL)
if (EditorUtilities.isTargetingOpenGLES)
{
EditorGUILayout.HelpBox("Auto exposure requires compute shader support (WebGPU) when running on Web.", MessageType.Warning);
EditorGUILayout.HelpBox("Auto exposure requires compute shader support which is not available for OpenGLES.", MessageType.Warning);
}
else if (EditorUtilities.isTargetingAndroid)
else if (EditorUtilities.isTargetingWebGL)
{
EditorGUILayout.HelpBox("Auto exposure requires compute shader support (Vulkan) when running on Android.", MessageType.Warning);
EditorGUILayout.HelpBox("Auto exposure requires compute shader support (WebGPU) when running on Web.", MessageType.Warning);
}

EditorUtilities.DrawHeaderLabel("Exposure");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;

#if XR_MANAGEMENT_4_0_1_OR_NEWER
Expand Down Expand Up @@ -79,6 +80,31 @@ public static bool isTargetingAndroid
}
}

/// <summary>
/// Returns <c>true</c> if the current build targets OpenGLES, <c>false</c> otherwise.
/// </summary>
public static bool isTargetingOpenGLES
{
get
{
var buildTargetAPIs = PlayerSettings.GetGraphicsAPIs(EditorUserBuildSettings.activeBuildTarget);

foreach (var api in buildTargetAPIs)
{
if (api == GraphicsDeviceType.OpenGLES3
#if !UNITY_2023_1_OR_NEWER
|| api == GraphicsDeviceType.OpenGLES2
#endif
)
{
return true;
}
}

return false;
}
}

/// <summary>
/// Returns <c>true</c> if the current target is WebGL, <c>false</c> otherwise.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public override bool IsEnabledAndSupported(PostProcessRenderContext context)
}

state &= SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isOpenGLES
&& !RuntimeUtilities.isWebNonWebGPU
#if UNITY_2023_2_OR_NEWER
&& SystemInfo.IsFormatSupported(GraphicsFormat.R32_SFloat, GraphicsFormatUsage.Render)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override bool IsEnabledAndSupported(PostProcessRenderContext context)
{
return enabled.value
&& SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isOpenGLES
&& !RuntimeUtilities.isWebNonWebGPU
&& RenderTextureFormat.RFloat.IsSupported()
&& context.resources.computeShaders.autoExposure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public bool IsRequestedAndSupported(PostProcessRenderContext context)
{
return requested
&& SystemInfo.supportsComputeShaders
&& !RuntimeUtilities.isAndroidOpenGL
&& !RuntimeUtilities.isOpenGLES
&& !RuntimeUtilities.isWebNonWebGPU
&& ShaderResourcesAvailable(context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,12 +850,16 @@ public static bool isVREnabled
}

/// <summary>
/// Returns <c>true</c> if the target platform is Android and the selected API is OpenGL,
/// Returns <c>true</c> if the target platform is does not support compute and the selected API is OpenGL,
/// <c>false</c> otherwise.
/// </summary>
public static bool isAndroidOpenGL
public static bool isOpenGLES
{
get { return Application.platform == RuntimePlatform.Android && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan; }
get { return (SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES3
#if !UNITY_2023_1_OR_NEWER
|| SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES2
#endif
); }
}

/// <summary>
Expand Down