Class Filter | Terrain Tools | 3.0.2-preview.3
docs.unity3d.com
    Show / Hide Table of Contents

    Class Filter

    Base class 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
    AbsFilter
    AddFilter
    AspectFilter
    ClampFilter
    ComplementFilter
    ConcavityFilter
    HeightFilter
    MaxFilter
    MinFilter
    MultiplyFilter
    NegateFilter
    NoiseFilter
    PowerFilter
    RemapFilter
    SlopeFilter
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: UnityEditor.Experimental.TerrainAPI
    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)

    Draw 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. Calls ValidateFilter and if that returns false, a default blit is performed instead of calling OnEval

    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

    GetDisplayName()

    Get 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

    GetElementHeight()

    Get 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()

    Get 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()

    Get the tooltip for the Filter.

    Declaration
    public virtual string GetToolTip()
    Returns
    Type Description
    String

    OnDisable()

    Called when the Filter is disabled

    Declaration
    public virtual void OnDisable()

    OnDrawGUI(Rect, FilterContext)

    Draw 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()

    Called when the Filter is first created

    Declaration
    public virtual void OnEnable()

    OnEval(FilterContext, RenderTexture, RenderTexture)

    Evaluate 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
    RenderTexture source
    RenderTexture dest

    OnSceneGUI(SceneView, FilterContext)

    Handle SceneView related logic or rendering

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

    SceneGUI(SceneView, FilterContext)

    Handle SceneView related logic or rendering

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

    ValidateFilter(FilterContext, out String)

    Called before OnEval. Use this to set up anything needed before Filter evaluation and to also tell the system whether or not the Filter is supported based on current hardware, the data provided by the provided FilterContext, etc. Do this by returning True or False.

    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
    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

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • 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 18 October 2023