Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image instead of black bars - VisualServer #27440

Closed
parralplex opened this issue Mar 26, 2019 · 9 comments
Closed

Image instead of black bars - VisualServer #27440

parralplex opened this issue Mar 26, 2019 · 9 comments

Comments

@parralplex
Copy link

Godot version:
3.1 stable

OS/device including version:
Windows 10

Issue description:
I am having problem setting texture to be used instead of black bars when application window is scaled. It always draws one color of texture(instead of the texture itself) like if it was zoomed in or something. Is this normal behaviour or a bug? I tried textures with defferent resolutions and also images instead of textures but nothing seems to work.

Example - godot icon is used as texture for black bars
godot_window

Normally i would expect that texture that is passed to visualServer will be scaled to the size corresponding bar instead of this.

Steps to reproduce:

var txt = preload("res://icon.png")

func _ready():
	VisualServer.black_bars_set_images( txt .get_rid(),  txt .get_rid(),  txt .get_rid(),  txt .get_rid())
	VisualServer.black_bars_set_margins(50,50,50,50)
@azagaya
Copy link
Contributor

azagaya commented Mar 29, 2020

Hi! I made a fix in rasterizer_canvas_gles3.cpp in 3.2 branch. The result is this:
border
However, idk if this is the desired result. It just preserves the size and aspect of the images.
Also, idk how to test in vulkan branch.

@azagaya
Copy link
Contributor

azagaya commented Mar 30, 2020

Should i make a PR for this for 3.2?

@parralplex
Copy link
Author

Well i would say go for it. It looks pretty good to me.

@azagaya
Copy link
Contributor

azagaya commented Mar 30, 2020

Perhaps i could also add the option to stretch the image to the margins instead of preserving the size.. would it be useful?

@parralplex
Copy link
Author

parralplex commented Mar 30, 2020

Well it might have its use cases for sure. I dont see a problem with adding that option too.

@azagaya
Copy link
Contributor

azagaya commented Mar 31, 2020

I created the PR... lets see if it get merged, as it would only be useful for 3.2 (4.0 doesn't have gles3 anymore).

@YeldhamDev YeldhamDev modified the milestones: 4.0, 3.2 Apr 1, 2020
@akien-mga
Copy link
Member

akien-mga commented Jul 3, 2020

@azagaya Do you have a project that can be used to test the fix? I'm trying with a couple lines as in the OP, but even with the fix I still get some pretty bad artifacts (even though it's much better with this fix that without).

@akien-mga
Copy link
Member

Fixed by #37475.

@azagaya
Copy link
Contributor

azagaya commented Jul 3, 2020

@azagaya Do you have a project that can be used to test the fix? I'm trying with a couple lines as in the OP, but even with the fix I still get some pretty bad artifacts (even though it's much better with this fix that without).

I'll make one after work today. I recently changed my notebook and lost the example project in the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants