docs.unity3d.com
    Show / Hide Table of Contents

    Interface IBrushRenderWithTerrain

    An interface that represent all of the functionality required to render a terrain-brush at a particular UV co-ordinate on a particular terrain.

    Inherited Members
    IPaintContextRender.SetupTerrainToolMaterialProperties(PaintContext, BrushTransform, Material)
    IPaintContextRender.RenderBrush(PaintContext, Material, Int32)
    IDisposable.Dispose()
    Namespace: UnityEditor.TerrainTools
    Syntax
    public interface IBrushRenderWithTerrain : IPaintContextRender, IDisposable

    Methods

    AcquireHeightmap(Boolean, Terrain, Rect, Int32)

    Gets the PaintContext for the height-map at the bounds specified, you need to say whether this is to be writable upon acquisition.

    Declaration
    PaintContext AcquireHeightmap(bool writable, Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0)
    Parameters
    Type Name Description
    Boolean writable

    Determines if we wish to allow writing to the height-map.

    Terrain terrain

    The initial terrain to acquire the height-map.

    Rect boundsInTerrainSpace

    The bounds of the height-map to use (in pixels).

    Int32 extraBorderPixels

    Extra padding on the bounds specified.

    Returns
    Type Description
    PaintContext

    Returns the paint context created.

    AcquireHolesTexture(Boolean, Terrain, Rect, Int32)

    Gets the PaintContext for the holes at the bounds specified, you need to say whether this is to be writable upon acquisition.

    Declaration
    PaintContext AcquireHolesTexture(bool writable, Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0)
    Parameters
    Type Name Description
    Boolean writable

    Determines if we wish to allow writing to the normal-map.

    Terrain terrain

    The initial terrain to acquire the normal-map.

    Rect boundsInTerrainSpace

    The bounds of the normal-map to use (in pixels).

    Int32 extraBorderPixels

    Extra padding on the bounds specified.

    Returns
    Type Description
    PaintContext

    Returns the paint context created.

    AcquireNormalmap(Boolean, Terrain, Rect, Int32)

    Gets the PaintContext for the normal-map at the bounds specified, you need to say whether this is to be writable upon acquisition.

    Declaration
    PaintContext AcquireNormalmap(bool writable, Terrain terrain, Rect boundsInTerrainSpace, int extraBorderPixels = 0)
    Parameters
    Type Name Description
    Boolean writable

    Determines if we wish to allow writing to the normal-map.

    Terrain terrain

    The initial terrain to acquire the normal-map.

    Rect boundsInTerrainSpace

    The bounds of the normal-map to use (in pixels).

    Int32 extraBorderPixels

    Extra padding on the bounds specified.

    Returns
    Type Description
    PaintContext

    Returns the paint context created.

    AcquireTexture(Boolean, Terrain, Rect, TerrainLayer, Int32)

    Gets the PaintContext for the texture-map at the bounds specified, you need to say whether this is to be writable upon acquisition.

    Declaration
    PaintContext AcquireTexture(bool writable, Terrain terrain, Rect boundsInTerrainSpace, TerrainLayer layer, int extraBorderPixels = 0)
    Parameters
    Type Name Description
    Boolean writable

    Determines if we wish to allow writing to the texture-map.

    Terrain terrain

    The initial terrain to acquire the texture-map.

    Rect boundsInTerrainSpace

    The bounds of the texture-map to use (in pixels).

    TerrainLayer layer

    The terrain layer to acquire the texture-map for.

    Int32 extraBorderPixels

    Extra padding on the bounds specified.

    Returns
    Type Description
    PaintContext

    Returns the paint context created.

    CalculateBrushTransform(Terrain, Vector2, Single, Single, out BrushTransform)

    Calculates the brush-transform on the specified terrain at the specified UV co-ordinates (taking into account scattering).

    Declaration
    bool CalculateBrushTransform(Terrain terrain, Vector2 uv, float size, float rotation, out BrushTransform brushTransform)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain to calculate the brush-transform for.

    Vector2 uv

    The UV co-ordinate on that terrain.

    Single size

    The size of the brush.

    Single rotation

    The rotation about the Y axis of the brush.

    BrushTransform brushTransform

    The brush-transform on the terrain at the specified UV co-ordinates.

    Returns
    Type Description
    Boolean

    The brush-transform on the terrain at the specified UV co-ordinates.

    CalculateBrushTransform(Terrain, Vector2, Single, out BrushTransform)

    Calculates the brush-transform on the specified terrain at the specified UV co-ordinates (taking into account scattering).

    Declaration
    bool CalculateBrushTransform(Terrain terrain, Vector2 uv, float size, out BrushTransform brushTransform)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain to calculate the brush-transform for.

    Vector2 uv

    The UV co-ordinate on that terrain.

    Single size

    The size of the brush.

    BrushTransform brushTransform

    The brush-transform on the terrain at the specified UV co-ordinates.

    Returns
    Type Description
    Boolean

    Returns "true" if calculated successfully, "false" otherwise.

    CalculateBrushTransform(Terrain, Vector2, out BrushTransform)

    Calculates the brush-transform on the specified terrain at the specified UV co-ordinates (taking into account scattering).

    Declaration
    bool CalculateBrushTransform(Terrain terrain, Vector2 uv, out BrushTransform brushTransform)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain to calculate the brush-transform for.

    Vector2 uv

    The UV co-ordinate on that terrain.

    BrushTransform brushTransform

    The brush-transform on the terrain at the specified UV co-ordinates.

    Returns
    Type Description
    Boolean

    Returns "true" if calculated successfully, "false" otherwise.

    Release(PaintContext)

    Releases the PaintContext specified, if this was made writable when acquired then we write back into the texture at this point.

    Declaration
    void Release(PaintContext paintContext)
    Parameters
    Type Name Description
    PaintContext paintContext

    The paint context to be released.

    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