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

Make the burn-in look more like a real terminal. #845

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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