Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


dimension

Dimensionality (type) of the render texture.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public override TextureDimension dimension { get; set; }

Remarks

By default render textures are "2D" type, but it is also possible to have Cubemap or 3D render textures by changing dimension before they are created.
Cubemap render textures are most often used for dynamic cubemap reflections, see Camera.RenderToCubemap. A cubemap render texture must have the same RenderTexture.width and RenderTexture.height, and must be power of two size.
3D (volumetric) render textures currently only work on compute shader capable platforms (like UsingDX11GL3Features). You can render into them using "random access writes" from a pixel shader or a compute shader. Use RenderTexture.volumeDepth to set 3D depth, and RenderTexture.enableRandomWrite to enable arbitrary writes into it.
Additional Resources: TextureDimension.