Godot Version
4.4.1stable
Question
I’m trying to create a 3d texture uniform for a compute shader, but it seems like even if i set texture’s depth > 1, it still creates a 2d texture with depth = 1:
var rd: RenderingDevice = RenderingServer.create_local_rendering_device()
var tex_format := RDTextureFormat.new()
tex_format.format = RenderingDevice.DATA_FORMAT_R16_UNORM
tex_format.width = 8
tex_format.height = 8
tex_format.depth = 8
tex_format.usage_bits = \
RenderingDevice.TEXTURE_USAGE_SAMPLING_BIT +\
RenderingDevice.TEXTURE_USAGE_STORAGE_BIT +\
RenderingDevice.TEXTURE_USAGE_CAN_COPY_FROM_BIT
print(tex_format.depth)
var texture: RID = rd.texture_create(tex_format, RDTextureView.new())
print(rd.texture_get_format(texture).depth)
prints:
8
1
Why is that so? And how can I actually create a 3d texture for my compute shader?
Thanks in advance!