From c05f3d03fad671b2c2f35df1abaf330b9f9d7cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Wed, 1 Jul 2020 19:39:45 +0200 Subject: [PATCH 1/9] Started to move as public a part of the material GUI --- .../Material/Decal/ShaderGraph/DecalGUI.cs | 2 +- .../Material/LayeredLit/LayeredLitGUI.cs | 2 +- .../Editor/Material/Lit/LitGUI.cs | 2 +- .../Editor/Material/MaterialHeaderScope.cs | 13 ++++++- .../Material/TerrainLit/TerrainLitGUI.cs | 2 +- .../Editor/Material/UIBlocks/HDShaderGUI.cs | 38 +++++++++++++++++-- .../UIBlocks/LightingShaderGraphGUI.cs | 13 ++++++- .../Material/UIBlocks/MaterialUIBlock.cs | 35 +++++++++++++++-- .../Material/UIBlocks/MaterialUIBlockList.cs | 2 +- .../Material/Unlit/ShaderGraph/HDUnlitGUI.cs | 2 +- .../Editor/Material/Unlit/UnlitGUI.cs | 2 +- 11 files changed, 96 insertions(+), 17 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalGUI.cs index 9c433bb1eb7..a666cd181d9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalGUI.cs @@ -38,6 +38,6 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro } // We don't have any keyword/pass to setup currently for decal shader graphs - protected override void SetupMaterialKeywordsAndPassInternal(Material material) {} + internal override void SetupMaterialKeywordsAndPassInternal(Material material) {} } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs index dd31c5a05ca..f313ac5a78c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs @@ -76,7 +76,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro const string kSpecularOcclusionMode = "_SpecularOcclusionMode"; - protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); static public void SetupLayersMappingKeywords(Material material) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitGUI.cs index 443503197ce..67059edc19b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitGUI.cs @@ -96,7 +96,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro protected const string kTransmittanceColorMap = "_TransmittanceColorMap"; protected const string kRefractionModel = "_RefractionModel"; - protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); // All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change static public void SetupMaterialKeywordsAndPass(Material material) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs index d30f3f851a8..18e720c8c00 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs @@ -18,7 +18,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// /// - internal struct MaterialHeaderScope : IDisposable + public struct MaterialHeaderScope : IDisposable { public readonly bool expanded; bool spaceAtEnd; @@ -26,6 +26,16 @@ internal struct MaterialHeaderScope : IDisposable int oldIndentLevel; #endif + /// + /// Creates a material header scope to display the foldout in the material UI. + /// + /// Title of the header + /// Bit index to use for the + /// + /// + /// + /// + /// public MaterialHeaderScope(string title, uint bitExpanded, MaterialEditor materialEditor, bool spaceAtEnd = true, Color colorDot = default(Color), bool subHeader = false) { bool beforeExpended = materialEditor.GetExpandedAreas(bitExpanded); @@ -66,6 +76,7 @@ internal struct MaterialHeaderScope : IDisposable ++EditorGUI.indentLevel; } + /// Dispose void IDisposable.Dispose() { if (expanded) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs index 97f65b3ed73..91f0d6a89bd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs @@ -374,6 +374,6 @@ bool ITerrainLayerCustomUI.OnTerrainLayerGUI(TerrainLayer terrainLayer, Terrain return true; } - protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); } } // namespace UnityEditor diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs index dd39cb40d5b..241980d0e1b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs @@ -17,14 +17,25 @@ namespace UnityEditor.Rendering.HighDefinition // of the material you must use Material UI Blocks, examples of doing so can be found in the classes UnlitGUI, // LitGUI or LayeredLitGUI. - abstract class HDShaderGUI : ShaderGUI + /// + /// Use this class to build your custom Shader GUI for HDRP. + /// You'll then be able to use the class that inherit from HDShaderGUI in the ShaderGraph Custom EditorGUI field. + /// + public abstract class HDShaderGUI : ShaderGUI { - protected bool m_FirstFrame = true; + internal protected bool m_FirstFrame = true; // The following set of functions are call by the ShaderGraph // It will allow to display our common parameters + setup keyword correctly for them - protected abstract void SetupMaterialKeywordsAndPassInternal(Material material); + internal abstract void SetupMaterialKeywordsAndPassInternal(Material material); + + /// + /// This function is called when a new shader is assigned to your material. + /// + /// The current material. + /// Previous shader before assignation. + /// The new incoming shader that will be assigned. public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader) { base.AssignNewShaderToMaterial(material, oldShader, newShader); @@ -34,6 +45,11 @@ public override void AssignNewShaderToMaterial(Material material, Shader oldShad SetupMaterialKeywordsAndPassInternal(material); } + /// + /// Setup the keywords and passes for the material. It is required to call this function after changing a property on a material to ensure it's validity. + /// + /// GUI.changed is the usual value for this parameter. If changed is false, the function will just exit. + /// The material to perform the setup on. protected void ApplyKeywordsAndPassesIfNeeded(bool changed, Material[] materials) { // !!! HACK !!! @@ -51,6 +67,9 @@ protected void ApplyKeywordsAndPassesIfNeeded(bool changed, Material[] materials } } + /// + /// Called by unity when displaying the GUI. This method is sealed, use OnMaterialGUI instead + /// public sealed override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props) { if (!(RenderPipelineManager.currentPipeline is HDRenderPipeline)) @@ -63,8 +82,17 @@ public sealed override void OnGUI(MaterialEditor materialEditor, MaterialPropert } } + /// + /// Implement your custom GUI in this function.false You'll probably want to use the MaterialUIBlock to display a UI similar to HDRP shaders. + /// + /// The current material editor. + /// The list of properties the material have. protected abstract void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] props); + /// + /// Reset the render queue of the material. + /// + /// The material which will be rested. protected static void ResetMaterialCustomRenderQueue(Material material) { HDRenderQueue.RenderQueueType targetQueueType; @@ -93,6 +121,10 @@ protected static void ResetMaterialCustomRenderQueue(Material material) kUseSplitLighting, kTransparentBackfaceEnable }; + /// + /// For ShaderGraph Only, synchronize a set of properties that is needed for ShaderGraph materials to work correctly. + /// + /// The target material. protected static void SynchronizeShaderGraphProperties(Material material) { var defaultProperties = new Material(material.shader); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs index 3f577ddb419..f820fedd4c4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// Common GUI for Lit ShaderGraphs /// - class LightingShaderGraphGUI : HDShaderGUI + public class LightingShaderGraphGUI : HDShaderGUI { // For surface option shader graph we only want all unlit features but alpha clip and back then front rendering const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Lit @@ -23,6 +23,11 @@ class LightingShaderGraphGUI : HDShaderGUI new AdvancedOptionsUIBlock(MaterialUIBlock.Expandable.Advance, ~AdvancedOptionsUIBlock.Features.SpecularOcclusion) }; + /// + /// Implement your custom GUI in this function.false You'll probably want to use the MaterialUIBlock to display a UI similar to HDRP shaders. + /// + /// The current material editor. + /// The list of properties the material have. protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] props) { using (var changed = new EditorGUI.ChangeCheckScope()) @@ -32,6 +37,10 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro } } + /// + /// Setups the keywords and passes for a Lit ShaderGraph material. + /// + /// The target material. public static void SetupMaterialKeywordsAndPass(Material material) { SynchronizeShaderGraphProperties(material); @@ -51,6 +60,6 @@ public static void SetupMaterialKeywordsAndPass(Material material) CoreUtils.SetKeyword(material, "_ADD_PRECOMPUTED_VELOCITY", material.GetInt(kAddPrecomputedVelocity) != 0); } - protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs index 54469704fc1..bc213ca866e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs @@ -6,16 +6,23 @@ namespace UnityEditor.Rendering.HighDefinition { - abstract class MaterialUIBlock + /// + /// Base implementation of a material GUI block to be disabled in the material inspector. + /// + public abstract class MaterialUIBlock { + /// The current material editor. protected MaterialEditor materialEditor; + /// The list of selected materials to edit. protected Material[] materials; + /// The list of available properties in the selected materials. protected MaterialProperty[] properties; + /// Parent of the UI block. protected MaterialUIBlockList parent; [Flags] - public enum Expandable : uint + internal enum Expandable : uint { // Standard Base = 1<<0, @@ -52,7 +59,7 @@ public enum Expandable : uint LayeringOption3 = 1 << 30 } - public void Initialize(MaterialEditor materialEditor, MaterialProperty[] properties, MaterialUIBlockList parent) + internal void Initialize(MaterialEditor materialEditor, MaterialProperty[] properties, MaterialUIBlockList parent) { this.materialEditor = materialEditor; this.parent = parent; @@ -62,12 +69,18 @@ public void Initialize(MaterialEditor materialEditor, MaterialProperty[] materialEditor.InitExpandableState(); } - public void UpdateMaterialProperties(MaterialProperty[] properties) + internal void UpdateMaterialProperties(MaterialProperty[] properties) { this.properties = properties; LoadMaterialProperties(); } + /// + /// Find a material property in the list of available properties. + /// + /// Name of the property. + /// Is the property mandatory for your inspector. + /// The material property found, null otherwise. protected MaterialProperty FindProperty(string propertyName, bool isMandatory = false) { // ShaderGUI.FindProperty is a protected member of ShaderGUI so we can't call it here: @@ -83,6 +96,13 @@ protected MaterialProperty FindProperty(string propertyName, bool isMandatory = return null; } + /// + /// Find a material property with layering option + /// + /// Name of the property. + /// Number of layers of the shader. + /// Is the property mandatory for your inspector. + /// The material property found, null otherwise. protected MaterialProperty[] FindPropertyLayered(string propertyName, int layerCount, bool isMandatory = false) { MaterialProperty[] properties = new MaterialProperty[layerCount]; @@ -99,7 +119,14 @@ protected MaterialProperty[] FindPropertyLayered(string propertyName, int layerC return properties; } + /// + /// Use this function to load the material properties you need in your block. + /// public abstract void LoadMaterialProperties(); + + /// + /// Draw the properties in your block. + /// public abstract void OnGUI(); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs index 0ca851ed8b6..b4661e4a9a2 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs @@ -14,7 +14,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// Wrapper to handle Material UI Blocks, it will handle initialization of the blocks when drawing the GUI. /// - class MaterialUIBlockList : List + public class MaterialUIBlockList : List { [System.NonSerialized] bool m_Initialized = false; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs index b416dccea53..cca6948dc15 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs @@ -36,6 +36,6 @@ public static void SetupMaterialKeywordsAndPass(Material material) UnlitGUI.SetupUnlitMaterialKeywordsAndPass(material); } - protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/UnlitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/UnlitGUI.cs index 224157a61d6..a57afe8881e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/UnlitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/UnlitGUI.cs @@ -30,7 +30,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro } } - protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupUnlitMaterialKeywordsAndPass(material); + internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupUnlitMaterialKeywordsAndPass(material); // All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change public static void SetupUnlitMaterialKeywordsAndPass(Material material) From b750e04e1f851dc999f51fba22092b0753c16e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Wed, 1 Jul 2020 19:51:28 +0200 Subject: [PATCH 2/9] Moved HDUnlitGUI to public --- .../Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs index cca6948dc15..31057fc8264 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// GUI for HDRP Unlit shader graphs /// - class HDUnlitGUI : HDShaderGUI + public class HDUnlitGUI : HDShaderGUI { const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit; @@ -21,6 +21,11 @@ class HDUnlitGUI : HDShaderGUI new AdvancedOptionsUIBlock(MaterialUIBlock.Expandable.Advance, ~AdvancedOptionsUIBlock.Features.SpecularOcclusion) }; + /// + /// Implement your custom GUI in this function.false You'll probably want to use the MaterialUIBlock to display a UI similar to HDRP shaders. + /// + /// The current material editor. + /// The list of properties the material have. protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] props) { using (var changed = new EditorGUI.ChangeCheckScope()) @@ -30,6 +35,10 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro } } + /// + /// Setups the keywords and passes for a Unlit ShaderGraph material. + /// + /// The target material. public static void SetupMaterialKeywordsAndPass(Material material) { SynchronizeShaderGraphProperties(material); From 5989d86ca9e86a4b549277c93bc33b1ad6ec705e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Fri, 3 Jul 2020 11:44:29 +0200 Subject: [PATCH 3/9] Moved back to internal --- .../Editor/Material/Decal/ShaderGraph/DecalGUI.cs | 2 +- .../Editor/Material/LayeredLit/LayeredLitGUI.cs | 2 +- .../Editor/Material/Lit/LitGUI.cs | 2 +- .../Editor/Material/MaterialHeaderScope.cs | 2 +- .../Editor/Material/TerrainLit/TerrainLitGUI.cs | 2 +- .../Editor/Material/UIBlocks/HDShaderGUI.cs | 2 +- .../Editor/Material/UIBlocks/LightingShaderGraphGUI.cs | 4 ++-- .../Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs | 4 ++-- .../Editor/Material/Unlit/UnlitGUI.cs | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalGUI.cs index a666cd181d9..9c433bb1eb7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalGUI.cs @@ -38,6 +38,6 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro } // We don't have any keyword/pass to setup currently for decal shader graphs - internal override void SetupMaterialKeywordsAndPassInternal(Material material) {} + protected override void SetupMaterialKeywordsAndPassInternal(Material material) {} } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs index f313ac5a78c..dd31c5a05ca 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs @@ -76,7 +76,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro const string kSpecularOcclusionMode = "_SpecularOcclusionMode"; - internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); static public void SetupLayersMappingKeywords(Material material) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitGUI.cs index 67059edc19b..443503197ce 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitGUI.cs @@ -96,7 +96,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro protected const string kTransmittanceColorMap = "_TransmittanceColorMap"; protected const string kRefractionModel = "_RefractionModel"; - internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); // All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change static public void SetupMaterialKeywordsAndPass(Material material) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs index 18e720c8c00..8d804e8147a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs @@ -18,7 +18,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// /// - public struct MaterialHeaderScope : IDisposable + internal struct MaterialHeaderScope : IDisposable { public readonly bool expanded; bool spaceAtEnd; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs index 91f0d6a89bd..97f65b3ed73 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs @@ -374,6 +374,6 @@ bool ITerrainLayerCustomUI.OnTerrainLayerGUI(TerrainLayer terrainLayer, Terrain return true; } - internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); } } // namespace UnityEditor diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs index 241980d0e1b..8fd2029d33b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs @@ -21,7 +21,7 @@ namespace UnityEditor.Rendering.HighDefinition /// Use this class to build your custom Shader GUI for HDRP. /// You'll then be able to use the class that inherit from HDShaderGUI in the ShaderGraph Custom EditorGUI field. /// - public abstract class HDShaderGUI : ShaderGUI + internal abstract class HDShaderGUI : ShaderGUI { internal protected bool m_FirstFrame = true; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs index f820fedd4c4..126be004bb1 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// Common GUI for Lit ShaderGraphs /// - public class LightingShaderGraphGUI : HDShaderGUI + internal class LightingShaderGraphGUI : HDShaderGUI { // For surface option shader graph we only want all unlit features but alpha clip and back then front rendering const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Lit @@ -60,6 +60,6 @@ public static void SetupMaterialKeywordsAndPass(Material material) CoreUtils.SetKeyword(material, "_ADD_PRECOMPUTED_VELOCITY", material.GetInt(kAddPrecomputedVelocity) != 0); } - internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs index 31057fc8264..b5a2ef0715e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// GUI for HDRP Unlit shader graphs /// - public class HDUnlitGUI : HDShaderGUI + internal class HDUnlitGUI : HDShaderGUI { const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit; @@ -45,6 +45,6 @@ public static void SetupMaterialKeywordsAndPass(Material material) UnlitGUI.SetupUnlitMaterialKeywordsAndPass(material); } - internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); + protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupMaterialKeywordsAndPass(material); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/UnlitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/UnlitGUI.cs index a57afe8881e..224157a61d6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/UnlitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/UnlitGUI.cs @@ -30,7 +30,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro } } - internal override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupUnlitMaterialKeywordsAndPass(material); + protected override void SetupMaterialKeywordsAndPassInternal(Material material) => SetupUnlitMaterialKeywordsAndPass(material); // All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change public static void SetupUnlitMaterialKeywordsAndPass(Material material) From cb8bfda5977466108a346d74ba8941ee143992f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Fri, 3 Jul 2020 11:45:27 +0200 Subject: [PATCH 4/9] internal --- .../Editor/Material/UIBlocks/MaterialUIBlock.cs | 2 +- .../Editor/Material/UIBlocks/MaterialUIBlockList.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs index bc213ca866e..86076c2b4f0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// Base implementation of a material GUI block to be disabled in the material inspector. /// - public abstract class MaterialUIBlock + abstract class MaterialUIBlock { /// The current material editor. protected MaterialEditor materialEditor; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs index b4661e4a9a2..0ca851ed8b6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs @@ -14,7 +14,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// Wrapper to handle Material UI Blocks, it will handle initialization of the blocks when drawing the GUI. /// - public class MaterialUIBlockList : List + class MaterialUIBlockList : List { [System.NonSerialized] bool m_Initialized = false; From 5df6f8132af3e4e9fe50a811ee1f72e4b42b45f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Fri, 3 Jul 2020 11:54:03 +0200 Subject: [PATCH 5/9] Fixed some doc --- .../Editor/Material/MaterialHeaderScope.cs | 13 ++++++------- .../Editor/Material/UIBlocks/HDShaderGUI.cs | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs index 8d804e8147a..f332161195b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs @@ -29,13 +29,12 @@ internal struct MaterialHeaderScope : IDisposable /// /// Creates a material header scope to display the foldout in the material UI. /// - /// Title of the header - /// Bit index to use for the - /// - /// - /// - /// - /// + /// Title of the header. + /// Bit index to use for the. + /// The current material editor. + /// Do the block shows a space at the bottom of it's UI. + /// Display a colored dot like in the layered UI material + /// Is sub-header, affects the style of the header public MaterialHeaderScope(string title, uint bitExpanded, MaterialEditor materialEditor, bool spaceAtEnd = true, Color colorDot = default(Color), bool subHeader = false) { bool beforeExpended = materialEditor.GetExpandedAreas(bitExpanded); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs index 8fd2029d33b..8e725196d46 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs @@ -28,7 +28,7 @@ internal abstract class HDShaderGUI : ShaderGUI // The following set of functions are call by the ShaderGraph // It will allow to display our common parameters + setup keyword correctly for them - internal abstract void SetupMaterialKeywordsAndPassInternal(Material material); + protected abstract void SetupMaterialKeywordsAndPassInternal(Material material); /// /// This function is called when a new shader is assigned to your material. From 4cffc212c38b1767e91fa2ab0f3934e63a5c7cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Mon, 6 Jul 2020 11:09:35 +0200 Subject: [PATCH 6/9] Fixed API doc --- .../Editor/Material/MaterialHeaderScope.cs | 8 +++---- .../Editor/Material/UIBlocks/HDShaderGUI.cs | 22 +++++++++---------- .../UIBlocks/LightingShaderGraphGUI.cs | 6 ++--- .../Material/UIBlocks/MaterialUIBlock.cs | 6 ++--- .../Material/Unlit/ShaderGraph/HDUnlitGUI.cs | 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs index f332161195b..c6a37f8b0b8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs @@ -32,9 +32,9 @@ internal struct MaterialHeaderScope : IDisposable /// Title of the header. /// Bit index to use for the. /// The current material editor. - /// Do the block shows a space at the bottom of it's UI. - /// Display a colored dot like in the layered UI material - /// Is sub-header, affects the style of the header + /// Set this to true to make the block include space at the bottom of its UI. Set to false to not include any space. + /// Specify a color to display a dot, like in the layered UI. + /// Set to true to make this into a sub-header. This affects the style of the header. Set to false to make this use the standard style. public MaterialHeaderScope(string title, uint bitExpanded, MaterialEditor materialEditor, bool spaceAtEnd = true, Color colorDot = default(Color), bool subHeader = false) { bool beforeExpended = materialEditor.GetExpandedAreas(bitExpanded); @@ -75,7 +75,7 @@ internal struct MaterialHeaderScope : IDisposable ++EditorGUI.indentLevel; } - /// Dispose + /// Disposes of the material scope header and cleans up any resources it used. void IDisposable.Dispose() { if (expanded) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs index 8e725196d46..b28d61e638a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs @@ -19,7 +19,7 @@ namespace UnityEditor.Rendering.HighDefinition /// /// Use this class to build your custom Shader GUI for HDRP. - /// You'll then be able to use the class that inherit from HDShaderGUI in the ShaderGraph Custom EditorGUI field. + /// You can use a class that inherits from HDShaderGUI in the Shader Graph Custom EditorGUI field. /// internal abstract class HDShaderGUI : ShaderGUI { @@ -31,11 +31,11 @@ internal abstract class HDShaderGUI : ShaderGUI protected abstract void SetupMaterialKeywordsAndPassInternal(Material material); /// - /// This function is called when a new shader is assigned to your material. + /// Unity calls this function when you assign a new shader to the material. /// /// The current material. - /// Previous shader before assignation. - /// The new incoming shader that will be assigned. + /// The shader the material currently uses. + /// The new shader to assign to the material. public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader) { base.AssignNewShaderToMaterial(material, oldShader, newShader); @@ -46,10 +46,10 @@ public override void AssignNewShaderToMaterial(Material material, Shader oldShad } /// - /// Setup the keywords and passes for the material. It is required to call this function after changing a property on a material to ensure it's validity. + /// Sets up the keywords and passes for the material. You must call this function after you change a property on a material to ensure it's validity. /// /// GUI.changed is the usual value for this parameter. If changed is false, the function will just exit. - /// The material to perform the setup on. + /// The materials to perform the setup on. protected void ApplyKeywordsAndPassesIfNeeded(bool changed, Material[] materials) { // !!! HACK !!! @@ -68,7 +68,7 @@ protected void ApplyKeywordsAndPassesIfNeeded(bool changed, Material[] materials } /// - /// Called by unity when displaying the GUI. This method is sealed, use OnMaterialGUI instead + /// Unity calls this function when it displays the GUI. This method is sealed so you cannot override it. To implement your custom GUI, use OnMaterialGUI instead. /// public sealed override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props) { @@ -83,16 +83,16 @@ public sealed override void OnGUI(MaterialEditor materialEditor, MaterialPropert } /// - /// Implement your custom GUI in this function.false You'll probably want to use the MaterialUIBlock to display a UI similar to HDRP shaders. + /// Implement your custom GUI in this function. To display a UI similar to HDRP shaders, use a MaterialUIBlock. /// /// The current material editor. - /// The list of properties the material have. + /// The list of properties the material has. protected abstract void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] props); /// /// Reset the render queue of the material. /// - /// The material which will be rested. + /// The material to reset the render queue of. protected static void ResetMaterialCustomRenderQueue(Material material) { HDRenderQueue.RenderQueueType targetQueueType; @@ -122,7 +122,7 @@ protected static void ResetMaterialCustomRenderQueue(Material material) }; /// - /// For ShaderGraph Only, synchronize a set of properties that is needed for ShaderGraph materials to work correctly. + /// Synchronize a set of properties that Unity requires for Shader Graph materials to work correctly. This function is for Shader Graph only. /// /// The target material. protected static void SynchronizeShaderGraphProperties(Material material) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs index 126be004bb1..8668f7bc4d6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs @@ -24,10 +24,10 @@ internal class LightingShaderGraphGUI : HDShaderGUI }; /// - /// Implement your custom GUI in this function.false You'll probably want to use the MaterialUIBlock to display a UI similar to HDRP shaders. + /// Implement your custom GUI in this function. To display a UI similar to HDRP shaders, use a MaterialUIBlock. /// /// The current material editor. - /// The list of properties the material have. + /// The list of properties the material has. protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] props) { using (var changed = new EditorGUI.ChangeCheckScope()) @@ -38,7 +38,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro } /// - /// Setups the keywords and passes for a Lit ShaderGraph material. + /// Sets up the keywords and passes for a Lit Shader Graph material. /// /// The target material. public static void SetupMaterialKeywordsAndPass(Material material) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs index 86076c2b4f0..52ec8656833 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs @@ -79,7 +79,7 @@ internal void UpdateMaterialProperties(MaterialProperty[] properties) /// Find a material property in the list of available properties. /// /// Name of the property. - /// Is the property mandatory for your inspector. + /// Specifies whether the property is mandatory for your Inspector. /// The material property found, null otherwise. protected MaterialProperty FindProperty(string propertyName, bool isMandatory = false) { @@ -101,7 +101,7 @@ protected MaterialProperty FindProperty(string propertyName, bool isMandatory = /// /// Name of the property. /// Number of layers of the shader. - /// Is the property mandatory for your inspector. + /// Specifies whether the property is mandatory for your Inspector. /// The material property found, null otherwise. protected MaterialProperty[] FindPropertyLayered(string propertyName, int layerCount, bool isMandatory = false) { @@ -125,7 +125,7 @@ protected MaterialProperty[] FindPropertyLayered(string propertyName, int layerC public abstract void LoadMaterialProperties(); /// - /// Draw the properties in your block. + /// Renders the properties in your block. /// public abstract void OnGUI(); } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs index b5a2ef0715e..a8f55db4afa 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs @@ -22,7 +22,7 @@ internal class HDUnlitGUI : HDShaderGUI }; /// - /// Implement your custom GUI in this function.false You'll probably want to use the MaterialUIBlock to display a UI similar to HDRP shaders. + /// Implement your custom GUI in this function. To display a UI similar to HDRP shaders, use a MaterialUIBlock. /// /// The current material editor. /// The list of properties the material have. @@ -36,7 +36,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro } /// - /// Setups the keywords and passes for a Unlit ShaderGraph material. + /// Sets up the keywords and passes for an Unlit Shader Graph material. /// /// The target material. public static void SetupMaterialKeywordsAndPass(Material material) From bb363cb1b3dac4b2b5ad91f49a2653dc87bb44c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Mon, 6 Jul 2020 11:13:00 +0200 Subject: [PATCH 7/9] Fix API doc --- .../Editor/Material/UIBlocks/HDShaderGUI.cs | 2 +- .../Editor/Material/UIBlocks/MaterialUIBlock.cs | 4 ++-- .../Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs index b28d61e638a..f6412d0e3a3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/HDShaderGUI.cs @@ -48,7 +48,7 @@ public override void AssignNewShaderToMaterial(Material material, Shader oldShad /// /// Sets up the keywords and passes for the material. You must call this function after you change a property on a material to ensure it's validity. /// - /// GUI.changed is the usual value for this parameter. If changed is false, the function will just exit. + /// GUI.changed is the usual value for this parameter. If this value is false, the function just exits. /// The materials to perform the setup on. protected void ApplyKeywordsAndPassesIfNeeded(bool changed, Material[] materials) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs index 52ec8656833..b4b0b60656f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs @@ -80,7 +80,7 @@ internal void UpdateMaterialProperties(MaterialProperty[] properties) /// /// Name of the property. /// Specifies whether the property is mandatory for your Inspector. - /// The material property found, null otherwise. + /// Returns the material property if it exists. Returns null otherwise. protected MaterialProperty FindProperty(string propertyName, bool isMandatory = false) { // ShaderGUI.FindProperty is a protected member of ShaderGUI so we can't call it here: @@ -102,7 +102,7 @@ protected MaterialProperty FindProperty(string propertyName, bool isMandatory = /// Name of the property. /// Number of layers of the shader. /// Specifies whether the property is mandatory for your Inspector. - /// The material property found, null otherwise. + /// Returns the material property if it exists. Returns null otherwise. protected MaterialProperty[] FindPropertyLayered(string propertyName, int layerCount, bool isMandatory = false) { MaterialProperty[] properties = new MaterialProperty[layerCount]; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs index a8f55db4afa..c8d2b76f70f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitGUI.cs @@ -25,7 +25,7 @@ internal class HDUnlitGUI : HDShaderGUI /// Implement your custom GUI in this function. To display a UI similar to HDRP shaders, use a MaterialUIBlock. /// /// The current material editor. - /// The list of properties the material have. + /// The list of properties the material has. protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] props) { using (var changed = new EditorGUI.ChangeCheckScope()) From aaee19aac4bd9b32205f99017e3d803039a37595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Tue, 7 Jul 2020 10:17:10 +0200 Subject: [PATCH 8/9] Add missing doc --- .../Editor/Material/MaterialHeaderScope.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs index c6a37f8b0b8..3a7e777dc04 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs @@ -30,7 +30,7 @@ internal struct MaterialHeaderScope : IDisposable /// Creates a material header scope to display the foldout in the material UI. /// /// Title of the header. - /// Bit index to use for the. + /// Bit index to store the state of header (collapsed or opened) in the Editor Prefs. /// The current material editor. /// Set this to true to make the block include space at the bottom of its UI. Set to false to not include any space. /// Specify a color to display a dot, like in the layered UI. From 5040ab9e088e91bbd2bf684c1a9a5f1c238c137a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Tue, 7 Jul 2020 14:15:04 +0200 Subject: [PATCH 9/9] Updated doc --- .../Editor/Material/MaterialHeaderScope.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs index 3a7e777dc04..edb6b3fd2b8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/MaterialHeaderScope.cs @@ -30,7 +30,7 @@ internal struct MaterialHeaderScope : IDisposable /// Creates a material header scope to display the foldout in the material UI. /// /// Title of the header. - /// Bit index to store the state of header (collapsed or opened) in the Editor Prefs. + /// Bit index which specifies the state of the header (whether it is open or collapsed) inside Editor Prefs. /// The current material editor. /// Set this to true to make the block include space at the bottom of its UI. Set to false to not include any space. /// Specify a color to display a dot, like in the layered UI.