mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
update the entite like crt shader it acc works and imrpoved blending of
the orverlay its a lil dim but oh well moved learning shader stuff to ShaderTestggvirw maybe integrate it later?
This commit is contained in:
@@ -13,12 +13,19 @@ using namespace metal;
|
||||
float2 uv = pos/size;
|
||||
|
||||
// scanwave
|
||||
half3 newCol = 0.75 + 0.5 + 0.5 * sin(time*0.5 + uv.y*10);
|
||||
half3 scanwave = 0.75 + 0.5 + 0.5 * sin(time*0.5 + uv.y*10);
|
||||
|
||||
//scanlines
|
||||
newCol *= 0.5 + 0.5 * sin(uv.y * 1250.0);
|
||||
half scanline = 0.5 + 0.5 * sin(uv.y * 1250.0);
|
||||
scanline *= 0.5;
|
||||
|
||||
half3 newColor = scanwave*scanline;
|
||||
|
||||
half alpha = 1 - scanline;
|
||||
alpha *= 0.75;
|
||||
|
||||
// half4 output = half4(layer.sample(pos).xyz*newCol, 1);
|
||||
half4 output = half4(color.xyz*newCol*0.5, 0.5);
|
||||
half4 output = half4(color.xyz*newColor*alpha, alpha);
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,67 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ShaderTestingView: View {
|
||||
@State private var start = Date.now
|
||||
|
||||
var body: some View {
|
||||
Image(systemName: "figure.walk.circle")
|
||||
.font(.system(size: 300))
|
||||
.foregroundStyle(.blue)
|
||||
.colorEffect(ShaderLibrary.redify())
|
||||
Section("Shaded") {
|
||||
TimelineView(.animation) { tl in
|
||||
let time = start.distance(to: tl.date)
|
||||
Image(systemName: "figure.walk.circle")
|
||||
.font(.system(size: 300))
|
||||
.foregroundStyle(.blue)
|
||||
.distortionEffect(
|
||||
ShaderLibrary.wave(
|
||||
.float(time)
|
||||
),
|
||||
maxSampleOffset: .zero
|
||||
)
|
||||
Rectangle()
|
||||
.frame(width: 200, height: 100)
|
||||
.padding(.vertical, 20)
|
||||
.foregroundStyle(.red)
|
||||
.compositingGroup()
|
||||
.visualEffect {
|
||||
content,
|
||||
proxy in
|
||||
content.distortionEffect(
|
||||
ShaderLibrary.waveFlag(
|
||||
.float(time),
|
||||
.float2(proxy.size)
|
||||
),
|
||||
maxSampleOffset: CGSize(width: 0, height: 40)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Section("Shaded") {
|
||||
TimelineView(.animation) { tl in
|
||||
let time = start.distance(to: tl.date)
|
||||
Rectangle()
|
||||
.frame(width: 300, height: 200)
|
||||
.colorEffect(
|
||||
ShaderLibrary.sinebow(
|
||||
.float2(300, 200),
|
||||
.float(time)
|
||||
)
|
||||
)
|
||||
Image(systemName: "figure.walk.circle")
|
||||
.font(.system(size: 300))
|
||||
.foregroundStyle(.blue)
|
||||
.colorEffect(ShaderLibrary.rainbow(
|
||||
.float(time)
|
||||
))
|
||||
}
|
||||
}
|
||||
Section("Original") {
|
||||
Image(systemName: "figure.walk.circle")
|
||||
.font(.system(size: 300))
|
||||
.foregroundStyle(.blue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,13 +18,6 @@ struct ContentView: View {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
List {
|
||||
ForEach(0..<6) {
|
||||
Color.red.frame(width: 60, height: 60, alignment: .center)
|
||||
.brightness(Double($0) * 0.2)
|
||||
.overlay(Text("\(Double($0) * 0.2 * 100, specifier: "%.0f")%"),
|
||||
alignment: .bottom)
|
||||
.border(Color.gray)
|
||||
}
|
||||
SessionsListView(
|
||||
handler: handler,
|
||||
hostsManager: hostsManager,
|
||||
|
||||
@@ -14,8 +14,6 @@ struct SettingsView: View {
|
||||
|
||||
@State private var blinkCursor: Int = 0
|
||||
@State var blinkTimer: Timer?
|
||||
@State private var start = Date.now
|
||||
@State private var touch = CGPoint.zero
|
||||
|
||||
func startBlinkingIfNeeded() {
|
||||
if hostsManager.settings.cursorType.blink {
|
||||
@@ -40,66 +38,6 @@ struct SettingsView: View {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
List {
|
||||
Section("Shaded") {
|
||||
TimelineView(.animation) { tl in
|
||||
let time = start.distance(to: tl.date)
|
||||
// Image(systemName: "figure.walk.circle")
|
||||
// .font(.system(size: 300))
|
||||
// .foregroundStyle(.blue)
|
||||
// .distortionEffect(
|
||||
// ShaderLibrary.wave(
|
||||
// .float(time)
|
||||
// ),
|
||||
// maxSampleOffset: .zero
|
||||
// )
|
||||
// Rectangle()
|
||||
// .frame(width: 200, height: 100)
|
||||
// .padding(.vertical, 20)
|
||||
// .foregroundStyle(.red)
|
||||
// .compositingGroup()
|
||||
// .visualEffect {
|
||||
// content,
|
||||
// proxy in
|
||||
// content.distortionEffect(
|
||||
// ShaderLibrary.waveFlag(
|
||||
// .float(time),
|
||||
// .float2(proxy.size)
|
||||
// ),
|
||||
// maxSampleOffset: CGSize(width: 0, height: 40)
|
||||
// )
|
||||
// }
|
||||
// .gesture(
|
||||
// DragGesture(minimumDistance: 0)
|
||||
// .onChanged { touch = $0.location}
|
||||
// )
|
||||
}
|
||||
}
|
||||
|
||||
Section("Shaded") {
|
||||
TimelineView(.animation) { tl in
|
||||
let time = start.distance(to: tl.date)
|
||||
Rectangle()
|
||||
.frame(width: 300, height: 200)
|
||||
.colorEffect(
|
||||
ShaderLibrary.sinebow(
|
||||
.float2(300, 200),
|
||||
.float(time)
|
||||
)
|
||||
)
|
||||
// Image(systemName: "figure.walk.circle")
|
||||
// .font(.system(size: 300))
|
||||
// .foregroundStyle(.blue)
|
||||
// .colorEffect(ShaderLibrary.rainbow(
|
||||
// .float(time)
|
||||
// ))
|
||||
}
|
||||
}
|
||||
Section("Original") {
|
||||
Image(systemName: "figure.walk.circle")
|
||||
.font(.system(size: 300))
|
||||
.foregroundStyle(.blue)
|
||||
}
|
||||
|
||||
Section("Terminal") {
|
||||
VStack(alignment: .leading) {
|
||||
HStack {
|
||||
|
||||
@@ -36,9 +36,12 @@ struct ShellView: View {
|
||||
// maxSampleOffset: .zero
|
||||
// )
|
||||
// }
|
||||
// .blendMode(.screen)
|
||||
.overlay {
|
||||
if hostsManager.settings.filter == .crt {
|
||||
CRTView()
|
||||
.opacity(0.75)
|
||||
.allowsHitTesting(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user