docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetChannelSwizzle

    SetChannelSwizzle(Channel, int)

    Sets a specific texture channel, for example Channel.R, to a specific position in the tensor.

    A color mask for tensor to texture conversions might override this setting.

    Declaration
    public TextureTransform SetChannelSwizzle(Channel c, int swizzle)
    Parameters
    Type Name Description
    Channel c

    The color channel to set.

    int swizzle

    The index in the channel tensor axis.

    Returns
    Type Description
    TextureTransform

    TextureTransform that you can use to chain other methods.

    SetChannelSwizzle(int, int, int, int)

    Sets which channels in the tensor map to which RGBA channels in the texture, using four channel position values.

    A color mask for tensor to texture conversions might override this setting.

    Declaration
    public TextureTransform SetChannelSwizzle(int channelSwizzleR = 0, int channelSwizzleG = 1, int channelSwizzleB = 2, int channelSwizzleA = 3)
    Parameters
    Type Name Description
    int channelSwizzleR

    Index in tensor channel axis for red texture channel.

    int channelSwizzleG

    Index in tensor channel axis for green texture channel.

    int channelSwizzleB

    Index in tensor channel axis for blue texture channel.

    int channelSwizzleA

    Index in tensor channel axis for alpha texture channel.

    Returns
    Type Description
    TextureTransform

    TextureTransform that you can use to chain other methods.

    SetChannelSwizzle(ChannelSwizzle)

    Sets which channels in the tensor map to which RGBA channels in the texture, using a ChannelSwizzle enum value.

    A color mask for tensor to texture conversions might override this setting.

    Declaration
    public TextureTransform SetChannelSwizzle(ChannelSwizzle channelSwizzle)
    Parameters
    Type Name Description
    ChannelSwizzle channelSwizzle

    The channel swizzle enum to use.

    Returns
    Type Description
    TextureTransform

    TextureTransform that you can use to chain other methods.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if unknown ChannelSwizzle is used.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)