Legacy Documentation: Version 2017.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

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 var dimension: Rendering.TextureDimension;
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.

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答