How to set images as black bars properly in VisualServer ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By parradoxSVK

Hello i am having problems with setting textures as black bars in VisualServer.
I cannot get it work properly. It always draws one color of the texture (instead of the texture itself) like if it was zoomed in or something. I tried doing it on GLES 2 with mixed result and also using images instead of textures but nothing seems to help. I guess it scales the texture in some strange way but there is nothing about it written in the docs so i am not sure. Does the texture have to have specific resolution for it to work ?

Code i use:

var top = ResourceLoader.load(“res://texture1.png”)
var bottom = ResourceLoader.load(“res://texture2.png”)
var right = ResourceLoader.load(“res://texture3.png”)
var left = ResourceLoader.load(“res://texture4.png”)
VisualServer.black_bars_set_images(left.get_rid(),top.get_rid(),right.get_rid(),bottom.get_rid())

I am running out of ideas of what to try so any help would be appreciated.

Godot version : 3.1

OS : Windows 10 64bit