Search Unity

RenderTexture.Create failed: 3D textures with depth are not supported. (Unity 2019.1.0)

Discussion in 'General Graphics' started by EceLStyle, Oct 13, 2019.

  1. EceLStyle

    EceLStyle

    Joined:
    Jul 29, 2016
    Posts:
    4
    Code (CSharp):
    1. RenderTexture texture = new RenderTexture(128, 128, 128,RenderTextureFormat.ARGB32);
    2. texture.enableRandomWrite = true;
    3. texture.dimension = UnityEngine.Rendering.TextureDimension.Tex3D;
    4. texture.volumeDepth = 128;
    5. texture.Create();

    RenderTexture.Create failed: 3D textures with depth are not supported.
    UnityEngine.RenderTexture:Create()


    I checked what's new and found this;

    https://unity3d.com/es/unity/whats-new/2019.1.0
    Graphics: Added extra validation for RT volumeDepth. (1096019)

    I could not find any documentation about what validation added.

    Unity version 2019.2.7f2 Personal (DX11) Windows 10
     
  2. grizzly

    grizzly

    Joined:
    Dec 5, 2012
    Posts:
    357
    Sounds like a terminology issue - It's referring to depth buffers, not volume or slice depth which I agree isn't entirely clear here.

    In this case you're setting a depth buffer of 128 bits in the constructor which is not only invalid (max is 24 bits for stencil support), but also simply not supported for 3D textures.

    Set the depth buffer parameter to zero:

    RenderTexture(128, 128, 0, RenderTextureFormat.ARGB32);
     
  3. EceLStyle

    EceLStyle

    Joined:
    Jul 29, 2016
    Posts:
    4
    grizzly likes this.