Skip to content

Commit

Permalink
Fix Editor Issue for LiftGammeGain and ShadowsMidtonesHighlights (#6813)
Browse files Browse the repository at this point in the history
* Initial commit

* Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
  • Loading branch information
johnpars and sebastienlagarde committed Feb 2, 2022
1 parent a571c53 commit 4362bab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed debug data for probes to not longer be cleared every time a cell is added/removed. This helps performance with streaming.
- Fixed APV loading data outside of the relevant area containing probes.
- Fixed the roughness value used for screen space reflections and ray traced reflections to match environment lighting (case 1390916).
- Fixed editor issue with the LiftGammaGain and ShadowsMidtonesHighlights volume components.

## [14.0.0] - 2021-11-17

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ sealed class TrackballUIDrawer
static GUIStyle s_WheelThumb;
static Vector2 s_WheelThumbSize;
static Material s_Material;
static bool s_MaterialConfigured;

Func<Vector4, Vector3> m_ComputeFunc;
bool m_ResetState;
Vector2 m_CursorPos;

static TrackballUIDrawer()
{
if (s_Material == null)
s_Material = new Material(Shader.Find("Hidden/HD PostProcessing/Editor/Trackball")) { hideFlags = HideFlags.HideAndDontSave };
}

public void OnGUI(SerializedProperty property, SerializedProperty overrideState, GUIContent title, Func<Vector4, Vector3> computeFunc)
{
if (property.propertyType != SerializedPropertyType.Vector4)
Expand All @@ -30,6 +25,13 @@ public void OnGUI(SerializedProperty property, SerializedProperty overrideState,
return;
}

if (!s_MaterialConfigured)
{
// Initialization of materials with Shader.Find from static constructors is not allowed.
s_Material = new Material(Shader.Find("Hidden/HD PostProcessing/Editor/Trackball")) { hideFlags = HideFlags.HideAndDontSave };
s_MaterialConfigured = true;
}

m_ComputeFunc = computeFunc;
var value = property.vector4Value;

Expand Down

0 comments on commit 4362bab

Please sign in to comment.