cool-retro-term icon indicating copy to clipboard operation
cool-retro-term copied to clipboard

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

Open ali1234 opened this issue 2 years ago • 11 comments

Screenshot @ 3104abd4ad7: image

Screenshot @ 4abbe332db25b70: image

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

ali1234 avatar Jul 19 '22 00:07 ali1234

This is a repeat of #703

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

Ashdemai avatar Jul 19 '22 13:07 Ashdemai

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 avatar Jul 19 '22 14:07 ali1234

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 avatar Jul 20 '22 01:07 ali1234

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

ali1234 avatar Jul 20 '22 01:07 ali1234

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.

jlederman avatar Jul 26 '22 18:07 jlederman

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

RassilonSleeps avatar Aug 04 '22 23:08 RassilonSleeps

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

The-Toblin avatar Oct 28 '22 07:10 The-Toblin

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.

WhiskeyTuesday avatar Dec 13 '22 05:12 WhiskeyTuesday

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.

spencershoe avatar Feb 16 '23 20:02 spencershoe

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.

pagesix1536 avatar May 25 '23 19:05 pagesix1536

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

The-Toblin avatar May 25 '23 19:05 The-Toblin