-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Enable trilinear filtering on OpenGL #1284
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
Conversation
106998a
to
46696b4
Compare
@rom1v . I tried playing pixel art games, however the trilinear filter affects the clarity of the pixel art games. I tried this branch out. Tested on Windows 10 20H1 (insiders). It did not happen on 1.12.1 |
Thank you for your test. Could you post screenshots showing the difference, please? |
Sure, I will post the screenshots in some time. I apologize the delay |
@rom1v, after the update, the The change is hardly noticeable, but I would like to have triliinear filter as the optional args Sorry for the bad screenshots, but is there any way to fix the lag on scrcpy now. These are my logs, if it could help:
|
Is your screenshot zoomed from what see on your computer, or is it a 1:1 screenshot from your computer screen?
Oh, interesting. Which platform? Does adding
It is optional (but enabled by default for now), with Since it improves text quality, I would like to keep it enabled by default, but it depends on whether it has too many drawbacks. |
Yes, both are a 1:1 screenshot taken on the PC.
Nope, I did a few restarts on my phone, to ensure nothing's hanging around.
What is meant by platform |
And on |
I meant By PS: Where does scrcpy push the server? Is there any way to kill the server if its still running, I suspect its still running. I have root, and termux, so it might be beneficial |
Could you compare If it's slow on |
Ok, will check in 5 min. (My builds are really slow). I guess I should do a reboot before the |
@rom1v PS: I tested it again. I guess the slow thing came over in |
OK, thank you. So could you |
I am not familiar with |
git checkout dev
git bisect start
git bisect bad # slowness problem on dev branch
git checkout master
git bisect good # works correctly on master
# loop:
# it checkouts some commit between master and dev
# build and run
ninja -Cx && ./run x
# if it's slow: git bisect bad
# if it works correctly: git bisect good
# if it knows which commit introduced the problem, it will tell you
# otherwise, goto loop |
woah. cool. thanks for this cool snippet. I will let you know asap. |
Until 1c6207f, it works quite smooth |
The expression port + 1 is promoted to int, but printed as uint16_t.
Include <string.h> for strdup() and strtok_r().
Some compilers warns on uninitialized value in impossible case: warning: variable 'result' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
Add an option to set a render driver hint (SDL_HINT_RENDER_DRIVER).
Improve downscaling quality if mipmapping is available. Suggested-by: Giumo Clanjor (哆啦比猫/兰威举) <[email protected]> Fixes #40 <#40> Ref: <#40 (comment)>
Add an option to disable trilinear filtering even if mipmapping is available.
@srevinsaju Could you please test this if you have time? |
Merged in |
@rom1v I apologize. I had a sudden inflow of I am sorry again. 😢 |
@srevinsaju Don't be sorry, everyone has other things to do 😉 I would like you confirm since which commit between |
Ok, I will let you know it asap. |
It might be better if the mipmap is only enabled when the scaling factor is below a threshold (e.g. when |
@rom1v I tested it on three devices. On three devices, I did not get the same results. I did a repeated iteration of |
Sid you find a specific commit where it strt to happen? Also, is it a lag on touch events, mouse events, keyboard events...? |
Its a lag on FRAME_RATE. The touch events works fine. Totally unrelated to the PR; I am building an AppImage for scrcpy, after some trial and error, I have tried to find the libraries which are required by This is my shortlist
These were the list given by ldd
Have I missed out any important |
Oh! If you record with Did you find a specific commit where it lags, and works fine on its parent commit? Scrcpy only depends on ffmpeg and sdl, the others are transitive depencies, depending on your ffmpeg build configuration. Ideally, you should build your own ffmpeg with only the minimum required for scrcpy (H.264 decoding, and probably other stuff from libavutil...). |
This PR aims to improve downscaling quality. See #40 (comment) for more details.
--render-driver
to force a renderer--no-mipmaps
to force-disable trilinear filteringcc @cjxgm
I'm hesitant to set
opengl
as the default render driver on Windows and macOS. I'm afraid that it could cause problems. What do you think?Please test with
--render-driver=opengl
on these platforms, and report any problems :)Note that this improves quality only for client downscaling (the device sends the video at full definition, and the client resizes the window).
The quality is still bad if the content is resized before encoding (
scrcpy -m 500
for example).