Version: 2020.3
LanguageEnglish
  • C#

RenderTexture.dimension

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public Rendering.TextureDimension dimension;

Description

Dimensionality (type) of the render texture.

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 width and 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 volumeDepth to set 3D depth, and enableRandomWrite to enable arbitrary writes into it.

See Also: TextureDimension.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961