- Home /
3D RenderTextures with Depth Not Supported (worked in <=2017.1, broken 2018+)
I'm working on migrating a 2017.1 project to 2019.1.0b6 and noticed that I'm getting errors when trying to create a 3D render texture. This code works fine in 2017 but doesn't in 2018 or 2019 because of the following error:
RenderTexture.Create failed: 3D textures with depth are not supported.
Is there a reason this capability was removed?
RenderTexture render = new RenderTexture((int)(texArray.width*scaling), (int)(texArray.height*scaling), (int)(texArray.depth * scaling), RenderTextureFormat.ARGBFloat);
render.useMipMap = true;
render.dimension = UnityEngine.Rendering.TextureDimension.Tex3D;
render.filterMode = FilterMode.Point;
//render.volumeDepth = (int)(texArray.depth*scaling);
render.enableRandomWrite = true;
render.Create();
Same error here. I found this,
https://unity3d.com/es/unity/whats-new/2019.1.0 Graphics: Added extra validation for RT volumeDepth. (1096019)
I wrote to forum, keep track this post https://forum.unity.com/threads/rendertexture-create-failed-3d-textures-with-depth-are-not-supported-unity-2019-1-0.759890/
I could not find any documentation about what validation added.
Unity version 2019.2.7f2 Personal (DX11) Windows 10
Answer by EceLStyle · Oct 13, 2019 at 06:54 PM
Ok, forum helped me,
It's a terminology error, depth is not volumeDepth, so in RenderTexture constructor use two dimension and depth 0 (depth buffer, is not volumeDepth/slice)
RenderTexture render = new RenderTexture(128,128,0); render.volumeDepth=128;
//use for volume
Thanks grizzly from unity forum.
Your answer
Follow this Question
Related Questions
Pixelart camera shader 2 Answers
Speeding up reading from a RenderTexture 3 Answers
RenderTexture.Create failed: format unsupported 0 Answers
Rendering an HD PNG off-screen? 0 Answers
Using URP how to make sprites lit by 3D Lights again? 6 Answers