Skip to content

Commit

Permalink
merged Swordfish90#845: Make the burn-in look more like a real terminal.
Browse files Browse the repository at this point in the history
  • Loading branch information
eric2801 committed Aug 14, 2024
1 parent f157648 commit 49570f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/qml/ApplicationSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ QtObject {
readonly property real maximumFontScaling: 2.50

readonly property real minBurnInFadeTime: 160
readonly property real maxBurnInFadeTime: 1600
readonly property real maxBurnInFadeTime: 160000

property bool isMacOS: Qt.platform.os === "osx"

Expand Down
9 changes: 4 additions & 5 deletions app/qml/BurnInEffect.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Loader {
property real lastUpdate: 0
property real prevLastUpdate: 0

property real burnIn: appSettings.burnIn
property real burnInFadeTime: 1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn)
property real burnIn: appSettings.burnIn;
property real burnInFadeTime: (1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn))*64
property real _minBurnInFadeTime: appSettings.minBurnInFadeTime
property real _maxBurnInFadeTime: appSettings.maxBurnInFadeTime

Expand Down Expand Up @@ -146,9 +146,8 @@ Loader {
float prevMask = accColor.a;
float currMask = rgb2grey(txtColor);
highp float blurDecay = clamp((lastUpdate - prevLastUpdate) * burnInTime, 0.0, 1.0);
blurDecay = max(0.0, blurDecay - prevMask);
vec3 blurColor = accColor.rgb - vec3(blurDecay);
highp float blurDecay = clamp(pow(0.5, burnInTime * (lastUpdate - prevLastUpdate)), 0.0, 1.0);
vec3 blurColor = accColor.rgb * vec3(blurDecay);
vec3 color = max(blurColor, txtColor);
gl_FragColor = vec4(color, currMask);
Expand Down
4 changes: 2 additions & 2 deletions app/qml/ShaderTerminal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ Item {

(burnIn !== 0 ? "
vec4 txt_blur = texture2D(burnInSource, staticCoords);
float blurDecay = clamp((time - burnInLastUpdate) * burnInTime, 0.0, 1.0);
vec3 burnInColor = 0.65 * (txt_blur.rgb - vec3(blurDecay));
float blurDecay = clamp(pow(0.5, burnInTime * (time - burnInLastUpdate)), 0.0, 1.0);
vec3 burnInColor = txt_blur.rgb * vec3(blurDecay);
txt_color = max(txt_color, convertWithChroma(burnInColor));"
: "") +

Expand Down

0 comments on commit 49570f0

Please sign in to comment.