• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Texture3D

    Inherits from:

    The Texture3D class in Unity pushes the boundaries of visual realism by adding a whole new dimension to texturing. As opposed to the flat grid of pixels in 2D textures, Texture3D provides a cubic matrix of pixel data - what one could imagine as a cube filled with colored pixels.

    This additional depth allows for more intricate manipulation and refined control over your textures, unlocking effects such as volumetric fog or 3D noise. Think of it like elevating a photograph into a diorama, adding layers of data beneath the surface image.

    In essence, a Texture3D expands the concept of a 2D texture into the third dimension. It shares height and width with a traditional texture but additionally gains a 'depth' attribute. This can be likened to stacking multiple 2D textures, one on top of the other, into a composite 3D cube.

    The advanced utilization of Texture3D can elevate the simulation realism, particularly in emulation of 3D environments or phenomena. To fully harness the superior control and visual complexity offered by Texture3D, the official Unity Texture3D documentation offers comprehensive insights and utilization techniques.

    Properties

    depth

    number
    ClientOnly
    ReadOnly

    The 'depth' property refers to the third dimension of the 3D texture. It lets you know how many layers deep the texture is. Unity's Texture3D.depth Documentation

    isReadable

    boolean
    ClientOnly
    ReadOnly

    The 'isReadable' property tells you if the Texture3D data can be read or not. Unity's Texture3D.isReadable Documentation

    Methods

    Apply

    ClientOnly

    The 'Apply' method is used to apply all previous set pixel and color changes. You can specify whether to update mipmap levels and if the texture should become unreadable after applying changes. Unity's Texture3D.Apply Documentation

    Returns

    void

    Apply

    ClientOnly

    The 'Apply' method is used to apply all previous set pixel and color changes. You can specify whether to update mipmap levels and if the texture should become unreadable after applying changes. Unity's Texture3D.Apply Documentation

    Parameters

    updateMipmaps
    boolean

    If set to true, the mipmap levels are recalculated.

    Returns

    void

    Apply

    ClientOnly

    The 'Apply' method is used to apply all previous set pixel and color changes. You can specify whether to update mipmap levels and if the texture should become unreadable after applying changes. Unity's Texture3D.Apply Documentation

    Parameters

    updateMipmaps
    boolean

    If set to true, the mipmap levels are recalculated.

    makeNoLongerReadable
    boolean

    If true, the texture becomes unreadable to save memory after application.

    Returns

    void

    Parameters

    srcElement
    number
    srcMip
    number
    dstElement
    number
    dstMip
    number

    Returns

    void

    Parameters

    srcElement
    number
    srcMip
    number
    srcX
    number
    srcY
    number
    srcWidth
    number
    srcHeight
    number
    dstElement
    number
    dstMip
    number
    dstX
    number
    dstY
    number

    Returns

    void

    GetPixel

    ClientOnly

    The 'GetPixel' method retrieves the color of a specific pixel at the provided location within the texture. Unity's Texture3D.GetPixel Documentation

    Parameters

    x
    number

    The horizontal coordinate of the pixel.

    y
    number

    The vertical coordinate of the pixel.

    z
    number

    The depth coordinate of the pixel.

    Returns

    Returns the color of the pixel at the specified coordinates.

    GetPixel

    ClientOnly

    The 'GetPixel' method retrieves the color of a specific pixel at the provided location within the texture. Unity's Texture3D.GetPixel Documentation

    Parameters

    x
    number

    The horizontal coordinate of the pixel.

    y
    number

    The vertical coordinate of the pixel.

    z
    number

    The depth coordinate of the pixel.

    mipLevel
    number

    Returns

    Returns the color of the pixel at the specified coordinates.

    The 'GetPixelBilinear' method fetches the color of a pixel using bilinear interpolation from the coordinates provided. This can give smoother results when fetching colors from textures. Unity's Texture3D.GetPixelBilinear Documentation

    Parameters

    u
    number

    The horizontal coordinate (between 0 and 1) of the pixel.

    v
    number

    The vertical coordinate (between 0 and 1) of the pixel.

    w
    number

    The depth coordinate (between 0 and 1) of the pixel.

    Returns

    Returns the color of the pixel with bilinear interpolation at the specified coordinates.

    The 'GetPixelBilinear' method fetches the color of a pixel using bilinear interpolation from the coordinates provided. This can give smoother results when fetching colors from textures. Unity's Texture3D.GetPixelBilinear Documentation

    Parameters

    u
    number

    The horizontal coordinate (between 0 and 1) of the pixel.

    v
    number

    The vertical coordinate (between 0 and 1) of the pixel.

    w
    number

    The depth coordinate (between 0 and 1) of the pixel.

    mipLevel
    number

    Returns

    Returns the color of the pixel with bilinear interpolation at the specified coordinates.

    Parameters

    miplevel
    number

    Returns

    SetPixel

    ClientOnly

    The 'SetPixel' method allows you to modify a pixel color at the specified position in the texture. It takes the position coordinates and new color as parameters. Unity's Texture3D.SetPixel Documentation

    Parameters

    x
    number

    The horizontal coordinate of the pixel.

    y
    number

    The vertical coordinate of the pixel.

    z
    number

    The depth coordinate of the pixel.

    color

    The new color of the pixel.

    Returns

    void

    SetPixel

    ClientOnly

    The 'SetPixel' method allows you to modify a pixel color at the specified position in the texture. It takes the position coordinates and new color as parameters. Unity's Texture3D.SetPixel Documentation

    Parameters

    x
    number

    The horizontal coordinate of the pixel.

    y
    number

    The vertical coordinate of the pixel.

    z
    number

    The depth coordinate of the pixel.

    color

    The new color of the pixel.

    mipLevel
    number

    Returns

    void

    Updated 8 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.