This repository was archived by the owner on Nov 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ void OnPreRender()
309
309
void BuildCommandBuffers ( )
310
310
{
311
311
var context = m_CurrentContext ;
312
- var sourceFormat = m_Camera . allowHDR ? RenderTextureFormat . DefaultHDR : RenderTextureFormat . Default ;
312
+ var sourceFormat = m_Camera . allowHDR ? RuntimeUtilities . defaultHDRRenderTextureFormat : RenderTextureFormat . Default ;
313
313
314
314
context . Reset ( ) ;
315
315
context . camera = m_Camera ;
Original file line number Diff line number Diff line change 6
6
using System . Text ;
7
7
using UnityEngine . Assertions ;
8
8
9
+ #if UNITY_EDITOR
10
+ using UnityEditor ;
11
+ #endif
12
+
9
13
namespace UnityEngine . Rendering . PostProcessing
10
14
{
11
15
using SceneManagement ;
@@ -283,6 +287,24 @@ public static bool isAndroidOpenGL
283
287
get { return Application . platform == RuntimePlatform . Android && SystemInfo . graphicsDeviceType != GraphicsDeviceType . Vulkan ; }
284
288
}
285
289
290
+ public static RenderTextureFormat defaultHDRRenderTextureFormat
291
+ {
292
+ get
293
+ {
294
+ #if UNITY_ANDROID || UNITY_IPHONE || UNITY_TVOS || UNITY_SWITCH || UNITY_EDITOR
295
+ RenderTextureFormat format = RenderTextureFormat . RGB111110Float ;
296
+ # if UNITY_EDITOR
297
+ var target = EditorUserBuildSettings . activeBuildTarget ;
298
+ if ( target != BuildTarget . Android && target != BuildTarget . iOS && target != BuildTarget . tvOS && target != BuildTarget . Switch )
299
+ return RenderTextureFormat . DefaultHDR ;
300
+ # endif // UNITY_EDITOR
301
+ if ( format . IsSupported ( ) )
302
+ return format ;
303
+ #endif // UNITY_ANDROID || UNITY_IPHONE || UNITY_TVOS || UNITY_SWITCH || UNITY_EDITOR
304
+ return RenderTextureFormat . DefaultHDR ;
305
+ }
306
+ }
307
+
286
308
public static void Destroy ( UnityObject obj )
287
309
{
288
310
if ( obj != null )
You can’t perform that action at this time.
0 commit comments