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

Commit 9280902

Browse files
committed
Fixed linear/srgb issues in the color grading editor (trackballs and curve editors)
1 parent 05cca28 commit 9280902

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

PostProcessing/Editor/Decorators/TrackballDecorator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public override bool OnGUI(SerializedProperty property, SerializedProperty overr
2222
{
2323
if (property.propertyType != SerializedPropertyType.Vector4)
2424
return false;
25-
25+
2626
var value = property.vector4Value;
2727

2828
using (new EditorGUILayout.VerticalScope())
@@ -67,13 +67,13 @@ void DrawWheel(ref Vector4 value, bool overrideState, TrackballAttribute attr)
6767
{
6868
// Retina support
6969
float scale = EditorGUIUtility.pixelsPerPoint;
70-
70+
7171
if (s_Material == null)
7272
s_Material = new Material(Shader.Find("Hidden/PostProcessing/Editor/Trackball")) { hideFlags = HideFlags.HideAndDontSave };
7373

7474
// Wheel texture
7575
var oldRT = RenderTexture.active;
76-
var rt = RenderTexture.GetTemporary((int)(size * scale), (int)(size * scale), 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
76+
var rt = RenderTexture.GetTemporary((int)(size * scale), (int)(size * scale), 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.sRGB);
7777
s_Material.SetFloat("_Offset", offset);
7878
s_Material.SetFloat("_DisabledState", overrideState ? 1f : 0.5f);
7979
s_Material.SetVector("_Resolution", new Vector2(size * scale, size * scale / 2f));
@@ -106,7 +106,7 @@ void DrawWheel(ref Vector4 value, bool overrideState, TrackballAttribute attr)
106106

107107
if (attr.mode == TrackballAttribute.Mode.None)
108108
return;
109-
109+
110110
// Values
111111
var displayValue = Vector3.zero;
112112

PostProcessing/Editor/Effects/ColorGradingEditor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public override void OnInspectorGUI()
195195
DoStandardModeGUI(true);
196196
else if (gradingMode == GradingMode.External)
197197
DoExternalModeGUI();
198-
198+
199199
EditorGUILayout.Space();
200200
}
201201

@@ -266,7 +266,7 @@ void DoStandardModeGUI(bool hdr)
266266

267267
EditorGUILayout.Space();
268268
EditorUtilities.DrawHeaderLabel("White Balance");
269-
269+
270270
PropertyField(m_Temperature);
271271
PropertyField(m_Tint);
272272

@@ -687,7 +687,7 @@ void DrawBackgroundTexture(Rect rect, int pass)
687687
float scale = EditorGUIUtility.pixelsPerPoint;
688688

689689
var oldRt = RenderTexture.active;
690-
var rt = RenderTexture.GetTemporary(Mathf.CeilToInt(rect.width * scale), Mathf.CeilToInt(rect.height * scale), 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
690+
var rt = RenderTexture.GetTemporary(Mathf.CeilToInt(rect.width * scale), Mathf.CeilToInt(rect.height * scale), 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.sRGB);
691691
s_MaterialGrid.SetFloat("_DisabledState", GUI.enabled ? 1f : 0.5f);
692692
s_MaterialGrid.SetFloat("_PixelScaling", EditorGUIUtility.pixelsPerPoint);
693693

0 commit comments

Comments
 (0)