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

disable linear filter when integer scaling #25

Open
retrotails opened this issue Feb 18, 2023 · 2 comments
Open

disable linear filter when integer scaling #25

retrotails opened this issue Feb 18, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@retrotails
Copy link

the following change uses nearest filtering if the window scale is an exact multiple, such as running a 1080p client full-screen on a 4k display.

diff --git a/src/renderer-egl.c b/src/renderer-egl.c
index 125bbb4..4d0acc8 100644
--- a/src/renderer-egl.c
+++ b/src/renderer-egl.c
@@ -527,6 +527,8 @@ void render_av_frames_egl(struct buffer* dst, struct vnc_av_frame** src,
 		GLuint tex = texture_from_av_frame(frame->frame);
 		glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex);
 
+		if (fmod(scale,1.0) == 0.0)
+			glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 		gl_draw();
 
 		glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);

I have only tested this with h264, it looks like it probably wouldn't work with the other modes and I don't know how to include it there.

@any1
Copy link
Owner

any1 commented Feb 18, 2023

Is this intended as an optimisation or to reduce blurriness?

@retrotails
Copy link
Author

to reduce blur. sway and I think macOS and windows do the same for upscaled apps.

@any1 any1 added the enhancement New feature or request label Mar 9, 2023
ac130kz added a commit to ac130kz/wlvncc that referenced this issue Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants