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 //scanlines
half scanline = 0.5 + 0.5 * sin(uv.y * 1250.0); half scanline = 0.5 + 0.5 * sin(uv.y * 1250.0);
scanline *= 0.5; // scanline *= 0.5;
half3 newColor = scanwave*scanline; half3 newColor = scanwave*scanline;
half alpha = 1 - scanline; half alpha = 1 - scanline;
alpha *= 0.5; alpha *= 1;
// half4 output = half4(layer.sample(pos).xyz*newCol, 1); // half4 output = half4(layer.sample(pos).xyz*newCol, 1);
half4 output = half4(color.xyz*newColor*alpha, alpha); 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() { func startFeedLoop() {
Task { Task {
guard let handler else { return } guard let handler else { return }
@@ -59,6 +63,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
if let read = handler.readFromChannel() { if let read = handler.readFromChannel() {
await MainActor.run { await MainActor.run {
self.feed(text: read) self.feed(text: read)
print(getTerminal().getCursorLocation())
} }
} else { } else {
try? await Task.sleep(nanoseconds: 10_000_000) //10ms try? await Task.sleep(nanoseconds: 10_000_000) //10ms

View File

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