Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Texture3D

Class for handling 3D Textures, Use this to create 3D texture assets.
Read time 6 minutesLast updated 2 days ago

Definition

  • Type: Class
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
  • Inherits from: Texture
public sealed class Texture3D : Texture

Remarks

3D textures are commonly used as lookup tables by shaders, or to represent volumetric data.
Typically you'd create a 3D texture, fill it up with data (Texture3D.SetPixels or Texture3D.SetPixels32) and call Texture3D.Apply to upload the data to the GPU.
Note that this class does not support Texture3D creation with a Crunch compression TextureFormat.

Constructors

Properties

Property

Description

depthThe depth of the texture (Read Only).
formatThe format of the pixel data in the texture (Read Only).

Methods

Method

Description

ApplyCopies changes you've made in a CPU texture to the GPU.
CopyPixelsCopies pixel data from another texture on the CPU.
GetPixelGets the pixel color at coordinates (
x
,
y
,
z
).
GetPixelBilinearGets the filtered pixel color at the normalized coordinates (
u
,
v
,
w
).
GetPixelDataGets the raw data from a texture.
GetPixelsGets the pixel color data for a mipmap level as Color structs.
GetPixels32Gets the pixel color data for a mipmap level as Color32 structs.
SetPixelSets the pixel color at coordinates (
x
,
y
,
z
).
SetPixelDataSets the raw data of an entire mipmap level directly in CPU memory.
SetPixelsSets the pixel colors of an entire mipmap level.
SetPixels32Sets the pixel colors of an entire mipmap level.
UpdateExternalTextureUpdates Unity texture to use different native texture object.

Static Methods

Method

Description

CreateExternalTextureCreates a Unity Texture out of an externally created native texture object.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.