godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.37k stars 21.26k forks source link

OpenGL: TextureArrays and Texture3D samplers not implemented yet #71029

Closed jmdejong closed 9 months ago

jmdejong commented 1 year ago

Godot version

Godot Engine v4.0.beta10

System information

archlinux; vulkan on dedicated NVIDIA GeForce RTX 3060 Laptop GPU; opengl3 on integrated AMD Radeon Graphics (renoir, LLVM 14.0.6, DRM 3.49, 6.1.1-arch1-1)

Issue description

With the opengl3 backend a shader will read a Samper2dArray uniform as being completely black.

opengl3: texturearray_opengl3

vulkan: texturearray_vulkan

used shader:

shader_type spatial;

uniform sampler2DArray textures : source_color, filter_linear_mipmap;

void fragment() {
    ALBEDO = texture(textures, vec3(UV, 1.0)).xyz;
}

Steps to reproduce

Create a scene with a meshinstance3d with the shader above as a material. Give that shader a Texture2DArray as parameter. With the vulkan renderer this will run fine, but with opengl3 the texture is read as being completely black.

Minimal reproduction project

sampler2darray.zip

clayjohn commented 1 year ago

Looks like this hasn't been implemented yet in the gl_compatibility nor have 3D textures. It should not be a lot of work to implement.

Wolfe2x7 commented 1 year ago

Good news: as of Godot 4.1 RC1, TextureArrays are now functional in the OpenGL Compatibility renderer. 👍 Texture3Ds are still not implemented yet.

The cube should be a bright color, not black:

Image3

alula commented 1 year ago

and here are Texture3Ds :eyes:

image