changed how the crt effect and terminal blend, now the colors arent washed out

This commit is contained in:
neon443
2025-08-27 11:21:46 +01:00
parent 2da7667ee5
commit 62debc38fb
3 changed files with 29 additions and 23 deletions

View File

@@ -22,12 +22,12 @@ using namespace metal;
//scanlines
half scanline = 0.5 + 0.5 * sin(uv.y * 1250.0);
scanline *= 0.5;
// scanline *= 0.5;
half3 newColor = scanwave*scanline;
half alpha = 1 - scanline;
alpha *= 0.5;
alpha *= 1;
// half4 output = half4(layer.sample(pos).xyz*newCol, 1);
half4 output = half4(color.xyz*newColor*alpha, alpha);

View File

@@ -52,6 +52,10 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
}
}
override func cursorStyleChanged(source: Terminal, newStyle: CursorStyle) {
}
func startFeedLoop() {
Task {
guard let handler else { return }
@@ -59,6 +63,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
if let read = handler.readFromChannel() {
await MainActor.run {
self.feed(text: read)
print(getTerminal().getCursorLocation())
}
} else {
try? await Task.sleep(nanoseconds: 10_000_000) //10ms

View File

@@ -16,34 +16,35 @@ struct ShellView: View {
@Environment(\.dismiss) var dismiss
@State var startTime: Date = .now
var body: some View {
NavigationStack {
let time = startTime.timeIntervalSinceNow
ZStack {
hostsManager.selectedTheme.background.suiColor
.ignoresSafeArea(.all)
TerminalController(handler: handler, hostsManager: hostsManager)
// .visualEffect { content, proxy in
// content
// .layerEffect(
// ShaderLibrary.crt(
// .float2(proxy.size),
// .float(time)
// ),
// maxSampleOffset: .zero
// )
// }
// .blendMode(.screen)
.overlay {
if hostsManager.settings.filter == .crt {
CRTView()
.opacity(0.75)
.allowsHitTesting(false)
ZStack {
TerminalController(handler: handler, hostsManager: hostsManager)
.colorMultiply(Color(red: 0.95, green: 1, blue: 0.95, opacity: 1))
.colorMultiply(.white)
// .visualEffect { content, proxy in
// content
// .layerEffect(
// ShaderLibrary.crt(
// .float2(proxy.size),
// .float(time)
// ),
// maxSampleOffset: .zero
// )
// }
.overlay {
if hostsManager.settings.filter == .crt {
CRTView()
.opacity(0.75)
.blendMode(.overlay)
.allowsHitTesting(false)
}
}
}
}
Group {
Color.gray.opacity(0.2)