CanvasItemShader Rect Size Built-In?

No, none that I’m aware of. You’ll need to pass that info to the shader somehow. You could connect to the Control.resized signal and pass the size that way to the shader.

Another option is to extend StyleBox and add the material there. The StyleBox._draw() method gives you the rect directly. More info in this answer How do I add a shader to a TextureProgressBar's texture_progress? - #4 by mrcdk

2 Likes