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,34 +16,35 @@ 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)
TerminalController(handler: handler, hostsManager: hostsManager) ZStack {
// .visualEffect { content, proxy in TerminalController(handler: handler, hostsManager: hostsManager)
// content .colorMultiply(Color(red: 0.95, green: 1, blue: 0.95, opacity: 1))
// .layerEffect( .colorMultiply(.white)
// ShaderLibrary.crt( // .visualEffect { content, proxy in
// .float2(proxy.size), // content
// .float(time) // .layerEffect(
// ), // ShaderLibrary.crt(
// maxSampleOffset: .zero // .float2(proxy.size),
// ) // .float(time)
// } // ),
// .blendMode(.screen) // maxSampleOffset: .zero
.overlay { // )
if hostsManager.settings.filter == .crt { // }
CRTView() .overlay {
.opacity(0.75) if hostsManager.settings.filter == .crt {
.allowsHitTesting(false) CRTView()
.opacity(0.75)
.blendMode(.overlay)
.allowsHitTesting(false)
}
} }
} }
Group { Group {
Color.gray.opacity(0.2) Color.gray.opacity(0.2)