-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
TextureAtlas doesn't work in shader when passed as sampler2D #25895
Comments
Might be related to this: #25049 |
Have the same problem. I had asked several times in Discord about it, no answer. So I had to cut my texture atlas on ~200 separated textures, and this is awful |
What is a "texture atlas"? Do you mean you passed an I'm quite skeptical as to how shaders are currently supposed to adjust sampling coordinates for |
shouldn't it crop it before passing it to the shader? I prefer the the first since it makes godot more flexible. |
The problem with baking region into the sampling operation under the hood, is that it will break the common use case. As I explained, when you draw an Preventing from setting atlas textures in shader parameters would also be inconvenient, despite the annoyance, because it prevents again the "common" use case. Those two use cases are both valid to me, but they can't work both without breaking compatibility. |
I really don't want to have to manually modify uv coords in the shader based on the region info passed in. |
Can confirm on version 3.2 on commit cbfb944 |
I ran into this while trying to work around the performance issues with Sprite3D, by trying to use an It won't work for geometry that uses perspective, maybe someone can rework it to do that. The important part is: vec2 uv_offset = region_origin * inv_atlas_size;
vec2 uv_scale = region_size * inv_atlas_size;
UV = UV * uv_scale + uv_offset; and then you'll need to somehow adjust for the atlas margins. |
the above solution is broken with godot 3.2.2.stable. |
this is related godotengine/godot-proposals#1708 |
Godot version: 3.0.6
Window 7 Home 64 bit
passed a texture atlas to a shader for palette swapping it seems like the shader ignores the texture atlas crop.
if you use separate images it works.
<-- palette
The text was updated successfully, but these errors were encountered: