Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add sampler2DArray as shader global due to strict class selection #81008

Closed
FireCatMagic opened this issue Aug 25, 2023 · 3 comments · Fixed by #91164
Closed

Cannot add sampler2DArray as shader global due to strict class selection #81008

FireCatMagic opened this issue Aug 25, 2023 · 3 comments · Fixed by #91164

Comments

@FireCatMagic
Copy link

FireCatMagic commented Aug 25, 2023

Godot version

v4.1.1.stable

System information

Godot v4.1.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 750 Ti (NVIDIA; 31.0.15.3623) - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)

Issue description

When creating a Shader Global of type sampler2DArray:
image
The expected resource is Texture2DArray.
image

Using an imported Texture2DArray does not work as they are actually imported as a CompressedTexture2DArray, and to my knowledge a normal Texture2DArray is impossible to create
image

Steps to reproduce

  1. Import a spritesheet as a Texture2DArray
  2. Notice the file is imported as a CompressedTexture2DArray resource
  3. Create a Shader Global of type sampler2DArray
  4. Try to add your texture array but notice that it only accepts Texture2DArray, while our import is CompressedTexture2DArray. To my knowledge, a Texture2DArray is impossible to import, it will always be a compressed array.

Expected behavior: sampler2DArray lets you select both Texture2DArray and CompressedTexture2DArray resources

All of the following types should be able to used in this field:
image

Minimal reproduction project

N/A

@bitsawer
Copy link
Member

We might need to allow some more subclasses to be used or adjust the type checks if they are too strict. Meanwhile, you might be able to use RenderingServer.global_shader_parameter_set() to set the CompressedTexture2DArray object directly during runtime (or in a tool script if running in editor).

@FireCatMagic
Copy link
Author

I focused this post on the CompressedTexture2DArray but after looking at the suggested resources for a sampler2DArray that is not global, it applies to more than just the singular class i was talking about if that wasn't obvious already
Pic of all the classes a sampler2DArray spot should have:
image

@FireCatMagic FireCatMagic changed the title Cannot add sampler2DArray as shader global due to Texture2D Array import compression Cannot add sampler2DArray as shader global due to strict class selection Aug 28, 2023
@akien-mga akien-mga added this to the 4.3 milestone Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants