Swordfish90 / cool-retro-term

A good looking terminal emulator which mimics the old cathode display...
21.84k stars 835 forks source link

CRT curvature fill in is white after "Improve terminal frame and expose frame size setting." #739

Open ali1234 opened 1 year ago

ali1234 commented 1 year ago

Screenshot @ 3104abd4ad7: image

Screenshot @ 4abbe332db25b70: image

This is with the frame size set to zero. Also note the reflected text at the top left.

Ashdemai commented 1 year ago

This is a repeat of #703

Is there anything that can be done to fix this issue?

ali1234 commented 1 year ago

If this is a nvidia-only issue as claimed on that issue, then it could be due to an uninitialized buffer. I forget where I saw it, but the other drivers will zero new buffers by default. Technically GL doesn't require that, so nvidia doesn't do it.

ali1234 commented 1 year ago

After going through the shader code it seems the problem is with the positiveLog helper function: https://github.com/Swordfish90/cool-retro-term/commit/4abbe332db25b70fce5b9994be3f6ec3982107ad#diff-cd3590184ef3de51987420ae526e23d1cbe53a6a353ceb217cd82b763120f1eeR75-R77

The frameColour is multiplied by the value it returns. The maximum value is 100.0, which is far too big and blows out whatever colour the frame was supposed to be, making it effectively full white all the time. Changing it to values like 2.0, 5.0, 10.0 etc results in the frame corners looking darker than the rest, like this: (note I have made the background green so i can easier see what is going on)

image

Changing the maximum value to 1.0 makes the frame look okay but makes the shadow look weird: image

Clamping the result only for the frame results in this: image

This last one looks the most reasonable to me, but I am not sure what it really supposed to look like. Also, I don't yet understand why this would only affect Nvidia drivers.

ali1234 commented 1 year ago

Another possible fix is to just revert the change from using clamp to max for the frame: https://github.com/Swordfish90/cool-retro-term/commit/4abbe332db25b70fce5b9994be3f6ec3982107ad#diff-cd3590184ef3de51987420ae526e23d1cbe53a6a353ceb217cd82b763120f1eeR90

This produces a similar result, but the frame and shadow are slightly lighter:

image

jlederman commented 1 year ago

I'm confirming this bug exists on Debian 11 with the latest nvidia drivers.

Also confirming that changes suggested by @ali1234 look good, except for the frame shadow as noted. Changing the max value compared in the positiveLog function from 100 to 1 fixes the screen curvature appearing opaque white, but also makes the frame shadow appear way too big. I'm comparing to the demo screenshots in the readme.

RassilonSleeps commented 1 year ago

Can also confirm bug is present on arch when run with nvidia drivers. kernel: 5.18.16-zen nvidia-dkms: 515.65.01-1

crt

The-Toblin commented 1 year ago

Chiming in here. Archlinux kernel: 6.0.5-zen1-1-zen nvidia-dkms: 520.56.06-2 crt: 1.2.0-2

(Don't have an old version to show it off working, sorry) crt

WhiskeyTuesday commented 1 year ago

Can confirm that changing L90 of app/qml/TerminalFrame.qml from frameShadow = max(sqrt(frameShadow), 0.0); to frameShadow = clamp(sqrt(frameShadow), 0.0, 1.0); and recompiling is a "good enough for now" fix for anyone who wants one.

spencershoe commented 1 year ago

this issue is now 7 months old, and last commit was a year ago according to github, is this project no longer maintained? based on the "solution" proposed by WhiskeyTuesday it doesn't appear to be that complicated of a fix.

pagesix1536 commented 1 year ago

this issue is now 7 months old, and last commit was a year ago according to github, is this project no longer maintained? based on the "solution" proposed by WhiskeyTuesday it doesn't appear to be that complicated of a fix.

Seems like it's a great time to fork this project and work on it separately while this one is just left to die a slow death.

The-Toblin commented 1 year ago

Tbh, I stopped using the program long ago. It's a fancy idea, but with the bugs and excessive system resource use...who cares?