Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit aee0f39

Browse files
committed
Cleaner fix for the sRGB issue in 19.1 while awaiting the engine fix
1 parent 94498dc commit aee0f39

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

PostProcessing/Runtime/PostProcessRenderContext.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,12 @@ RenderTextureDescriptor GetDescriptor(int depthBufferBits = 0, RenderTextureForm
341341
modifiedDesc.colorFormat = colorFormat;
342342

343343
#if UNITY_2019_1_OR_NEWER
344-
// Reversed behavior in 2019.1 when RenderTextureFormat.Default is set...
345-
modifiedDesc.sRGB = readWrite == RenderTextureReadWrite.Linear;
344+
if (readWrite == RenderTextureReadWrite.sRGB)
345+
modifiedDesc.sRGB = true;
346+
else if (readWrite == RenderTextureReadWrite.Linear)
347+
modifiedDesc.sRGB = false;
348+
else if (readWrite == RenderTextureReadWrite.Default)
349+
modifiedDesc.sRGB = QualitySettings.activeColorSpace != ColorSpace.Gamma;
346350
#else
347351
modifiedDesc.sRGB = readWrite != RenderTextureReadWrite.Linear;
348352
#endif

0 commit comments

Comments
 (0)