docs.unity3d.com
    Show / Hide Table of Contents

    Class Filter

    Provides methods for implementing Filters that operate on Textures. Used as elements in a FilterStack but can also be used by themselves. Inherit from this class and override functions to create your own Filter.

    Inheritance
    Object
    Object
    ScriptableObject
    Filter
    Inherited Members
    UnityEngine.ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    UnityEngine.ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    UnityEngine.Object.GetHashCode()
    UnityEngine.Object.Equals(System.Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    UnityEngine.Object.Instantiate<T>(T)
    UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
    UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
    UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
    UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, Boolean)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
    UnityEngine.Object.DestroyObject(UnityEngine.Object)
    UnityEngine.Object.FindSceneObjectsOfType(System.Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    UnityEngine.Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
    UnityEngine.Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    UnityEngine.Object.FindFirstObjectByType<T>()
    UnityEngine.Object.FindAnyObjectByType<T>()
    UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
    UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEditor.TerrainTools
    Syntax
    [Serializable]
    public class Filter : ScriptableObject

    Fields

    enabled

    Flag that is used to determine whether or not the Filter is enabled and should be evaluated when part of a FilterStack. If it is not enabled, it is skipped during FilterStack evaluation

    Declaration
    [SerializeField]
    public bool enabled
    Field Value
    Type Description
    Boolean

    Methods

    DrawGUI(Rect, FilterContext)

    Draws the GUI for the Filter.

    Declaration
    public void DrawGUI(Rect rect, FilterContext filterContext)
    Parameters
    Type Name Description
    Rect rect

    The Rect where the GUI should be drawn.

    FilterContext filterContext

    The FilterContext related to the current evaluation. Use this to show different information in the Filter GUI.

    Eval(FilterContext, RenderTexture, RenderTexture)

    Evaluates the Filter.

    Declaration
    public void Eval(FilterContext filterContext, RenderTexture source, RenderTexture dest)
    Parameters
    Type Name Description
    FilterContext filterContext

    The FilterContext related to the current evaluation.

    RenderTexture source

    The source RenderTexture on which the Filter operates.

    RenderTexture dest

    The destination RenderTexture to which the Filter blits the results of the Filter evaluation.

    Remarks

    This method calls ValidateFilter(FilterContext, out String) and checks if it returns false performing a default blit instead of calling OnEval.

    GetDisplayName()

    Gets the display name for the Filter. This is used when drawing the Filter's user interface.

    Declaration
    public virtual string GetDisplayName()
    Returns
    Type Description
    String

    Returns the display name of the Filter.

    GetElementHeight()

    Gets the height of the Filter element when drawn as part of a FilterStack GUI.

    Declaration
    public virtual float GetElementHeight()
    Returns
    Type Description
    Single

    The height of the Filter in the FilterStack GUI.

    GetObjectsToSerialize()

    Gets a list of Unity Objects to serialize along with the Filter object.

    Declaration
    public virtual List<Object> GetObjectsToSerialize()
    Returns
    Type Description
    List<Object>

    List of Unity Objects to serialize.

    GetToolTip()

    Gets the tooltip for the Filter.

    Declaration
    public virtual string GetToolTip()
    Returns
    Type Description
    String

    Returns the tooltip of the Filter.

    OnDisable()

    Sets data when the Filter is disabled.

    Declaration
    public virtual void OnDisable()

    OnDrawGUI(Rect, FilterContext)

    Draws the GUI for the Filter.

    Declaration
    protected virtual void OnDrawGUI(Rect rect, FilterContext filterContext)
    Parameters
    Type Name Description
    Rect rect

    The Rect where the GUI should be drawn.

    FilterContext filterContext

    The FilterContext related to the current evaluation. Use this to show different information in the Filter GUI.

    OnEnable()

    Sets data when the Filter is first created.

    Declaration
    public virtual void OnEnable()

    OnEval(FilterContext, RenderTexture, RenderTexture)

    Evaluates the Filter. Override this function for custom Filter logic.

    Declaration
    protected virtual void OnEval(FilterContext filterContext, RenderTexture source, RenderTexture dest)
    Parameters
    Type Name Description
    FilterContext filterContext

    The FilterContext related to the current evaluation.

    RenderTexture source

    The source RenderTexture on which the Filter operates.

    RenderTexture dest

    The destination RenderTexture to which the Filter blits the results of the Filter operation.

    OnSceneGUI(SceneView, FilterContext)

    Handles SceneView related logic or rendering.

    Declaration
    protected virtual void OnSceneGUI(SceneView sceneView, FilterContext filterContext)
    Parameters
    Type Name Description
    SceneView sceneView

    The SceneView in focus.

    FilterContext filterContext

    The FilterContext related to the current evaluation.

    SceneGUI(SceneView, FilterContext)

    Handles SceneView related logic or rendering.

    Declaration
    public void SceneGUI(SceneView sceneView, FilterContext filterContext)
    Parameters
    Type Name Description
    SceneView sceneView

    The SceneView in focus.

    FilterContext filterContext

    The FilterContext related to the current evaluation.

    ValidateFilter(FilterContext, out String)

    Sets up necessary data needed before the Filter is evaluated.

    Declaration
    public virtual bool ValidateFilter(FilterContext filterContext, out string message)
    Parameters
    Type Name Description
    FilterContext filterContext

    The FilterContext related to the current evaluation

    String message

    The message to display from validation results.

    Returns
    Type Description
    Boolean

    Whether or not the Filter is supported and should be evaluated. True = supported and is okay to evaluate. False = the Filter is not supported with the current hardware and should be skipped.

    Remarks

    While the data is being set the system is informed whether or not the Filter is supported based on current hardware, the data provided by the provided FilterContext, etc. This is completed by returning True or False. This method is called before OnEval.

    Back to top
    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on Friday, November 3, 2023