Class HDShaderGUI
Use this class to build your custom Shader GUI for HDRP. You can use a class that inherits from HDShaderGUI in the Shader Graph Custom EditorGUI field.
Inherited Members
Namespace: UnityEditor.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Editor.dll
Syntax
public abstract class HDShaderGUI : ShaderGUI
Methods
OnGUI(MaterialEditor, MaterialProperty[])
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.
Declaration
public override sealed void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
Parameters
Type | Name | Description |
---|---|---|
MaterialEditor | materialEditor | Material editor instance. |
MaterialProperty[] | props | The list of properties in the inspected material(s). |
Overrides
OnMaterialGUI(MaterialEditor, MaterialProperty[])
Implement your custom GUI in this function. To display a UI similar to HDRP shaders, use a MaterialUIBlockList.
Declaration
protected abstract void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] props)
Parameters
Type | Name | Description |
---|---|---|
MaterialEditor | materialEditor | The current material editor. |
MaterialProperty[] | props | The list of properties in the inspected material(s). |
OnMaterialInteractivePreviewGUI(MaterialEditor, Rect, GUIStyle)
Override the material interactive preview GUI.
Declaration
public override void OnMaterialInteractivePreviewGUI(MaterialEditor materialEditor, Rect r, GUIStyle background)
Parameters
Type | Name | Description |
---|---|---|
MaterialEditor | materialEditor | The current material editor. |
Rect | r | Preview rect. |
GUIStyle | background | Style for the background. |
Overrides
OnMaterialPreviewGUI(MaterialEditor, Rect, GUIStyle)
Override the material preview GUI.
Declaration
public override void OnMaterialPreviewGUI(MaterialEditor materialEditor, Rect r, GUIStyle background)
Parameters
Type | Name | Description |
---|---|---|
MaterialEditor | materialEditor | The current material editor. |
Rect | r | Preview rect. |
GUIStyle | background | Style for the background. |
Overrides
SetupMaterialKeywordsAndPass(Material)
Sets up the keywords and passes for the material you pass in as a parameter.
Declaration
[Obsolete("SetupMaterialKeywordsAndPass has been renamed ValidateMaterial", false)]
protected virtual void SetupMaterialKeywordsAndPass(Material material)
Parameters
Type | Name | Description |
---|---|---|
Material | material | Target material. |