Ok, I finally found the issue, =)
And yes, it was my code ( I admit ), but on something very counter intuitive.
Maybe someone can help me ? :#
I though that the _on_xxx_draw( ) was simply called once for rendering on a texture buffer.
But it seems more complex.
For example,
This code inside a Node2D runs at super low 7 fps :
var ss = 0
func _process(delta):
pass
func _on_Background_draw():
var h:int = 500
for i in h:
var pt1 = Vector2(0,i)
var pt2 = Vector2(500,i)
var c = Color(0,0, float(i)/(h+ss))
draw_line(pt1,pt2, c)
But, if I replace all the draw_line for loop with a draw_rectangle, it goes to 60 fps.
If the _on_draw() callback was only called once to fill a texture, it should not affect the frame rate at all, whatever the process is done in the function no ?
Any explanation on this ???
PS : yes, I know there are better ways to do gradient, but this is not the point here.