Godot Version
4.3.stable
Question
I have a texture progress bar and want to generate its texture with a shader.
I am using a similar approach to what I am doing with texture rects. In the TextureRect Node you can set the texture as a PlaceHolderTexture2D, then populate the material field with a shader, here is an example of the bar generated only by a shader in TextureRect.
Now the problem is in TextureProgressBar, there I set the progress as a PlaceHolderTexture2D, and with the same shader as before I am getting a single pixel:
Changing the size of the placeholder texture from 1x1 to the right size (88x4) is giving this result, which is working and with the right size (sorry for the size inconsistency in the screenshots, they should be all same lenght), but distorted:
Now I noticed that in the TextureRect the default value for stretch_mode is “Scale”, changing this value will make me obtain similar results to the wrong bars I am obtaining in TextureProgressBar (for example setting it to “Tile” is rendering it identical to the last image, while if I set it to “Keep” it is giving the one pixel render of the second image, though in this case if I set the PlaceHolderTexture2D to 88x4 there are no problems).
Is there a similar option to stretch_mode for progress bars to solve this problem?