FEATURE REQUEST: Spritesheet's frame UV in fragment shader

Context: in a fragment shader, I need the fragment UV coordinate within the particular frame of a spritesheet, in a material that will be reused across multiple spritesheets.

From what I understand, currently I have to do it the hard way by passing uniforms to the shader to know how many rows and columns the spritesheet has, and what is the coordinate of the current frame, in oder to compute the frame’s UV from the spritesheet texture UV. If the spritesheet happens to have separations and borders, it becomes even more complex.

It would be so convenient to just have a “FUV” (Frame UV) built-in instead.

Godot v4.3.stable - Windows 10.0.26100 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4060 Laptop GPU (NVIDIA; 32.0.15.5597) - Intel(R) Core(TM) i9-14900HX (32 Threads)

You should probably post feature requests on the Godot GitHub page.

1 Like

Thanks for the suggestion, I just did it: