diff --git a/Sources/UntoldEditor/Editor/Environment/AntiAliasingEditorView.swift b/Sources/UntoldEditor/Editor/Environment/AntiAliasingEditorView.swift index 8d9118f..daa7a84 100644 --- a/Sources/UntoldEditor/Editor/Environment/AntiAliasingEditorView.swift +++ b/Sources/UntoldEditor/Editor/Environment/AntiAliasingEditorView.swift @@ -17,6 +17,7 @@ import UntoldEngine struct AntiAliasingEditorView: View { @ObservedObject var fxaaSettings = FXAAParams.shared @ObservedObject var smaaSettings = SMAAParams.shared + private let taaSettings = TAAParams.shared @State private var selectedMode = EditorAntiAliasingOption.currentEngineMode() @State private var showAdvanced = false @@ -117,6 +118,36 @@ struct AntiAliasingEditorView: View { } case .msaa: EmptyView() + case .taa, .msaaTaa: + DisclosureGroup("Advanced", isExpanded: $showAdvanced) { + VStack(alignment: .leading, spacing: 8) { + UndoableEffectSlider( + label: "History Weight", + undoName: "Change TAA History Weight", + range: 0.5 ... 0.98, + help: "How much of the previous frames the resolve keeps. Higher smooths more and settles slower; lower follows motion sooner.", + get: { taaSettings.historyWeight }, + set: { taaSettings.historyWeight = $0 } + ) + UndoableEffectSlider( + label: "Clip Gamma", + undoName: "Change TAA Clip Gamma", + range: 0.5 ... 3.0, + help: "How far the history may stray from the frame's neighbourhood before it is clipped. Lower rejects ghosts sooner; higher keeps more of the history on thin detail.", + get: { taaSettings.clipGamma }, + set: { taaSettings.clipGamma = $0 } + ) + UndoableEffectSlider( + label: "Jitter Scale", + undoName: "Change TAA Jitter Scale", + range: 0.0 ... 1.0, + help: "The sub-pixel offset of the projection each frame, as a share of the full sequence. 0 turns the jitter off and leaves the resolve's blend alone.", + get: { taaSettings.jitterScale }, + set: { taaSettings.jitterScale = $0 } + ) + } + .padding(.top, 4) + } } } .padding(.vertical, 4) diff --git a/Sources/UntoldEditor/Editor/Environment/EditorAntiAliasingOption.swift b/Sources/UntoldEditor/Editor/Environment/EditorAntiAliasingOption.swift index 6bee4af..8a9a6c0 100644 --- a/Sources/UntoldEditor/Editor/Environment/EditorAntiAliasingOption.swift +++ b/Sources/UntoldEditor/Editor/Environment/EditorAntiAliasingOption.swift @@ -19,6 +19,10 @@ enum EditorAntiAliasingOption: String, CaseIterable, Hashable, Identifiable { case fxaa = "FXAA" case smaa = "SMAA" case msaa = "MSAA" + /// Temporal: the projection jittered each frame and the frame blended with its history. + case taa = "TAA" + /// 4× MSAA on the geometry with the temporal resolve on top. + case msaaTaa = "MSAA+TAA" var id: String { rawValue @@ -34,6 +38,10 @@ enum EditorAntiAliasingOption: String, CaseIterable, Hashable, Identifiable { return .smaa case .msaa: return .msaa + case .taa: + return .taa + case .msaaTaa: + return .msaaTaa } } @@ -47,6 +55,10 @@ enum EditorAntiAliasingOption: String, CaseIterable, Hashable, Identifiable { return .smaa case .msaa: return .msaa + case .taa: + return .taa + case .msaaTaa: + return .msaaTaa } } } diff --git a/Sources/UntoldEditor/Editor/Environment/EditorTonemapOption.swift b/Sources/UntoldEditor/Editor/Environment/EditorTonemapOption.swift index 6a5c3cf..6faa7f9 100644 --- a/Sources/UntoldEditor/Editor/Environment/EditorTonemapOption.swift +++ b/Sources/UntoldEditor/Editor/Environment/EditorTonemapOption.swift @@ -17,6 +17,9 @@ import UntoldEngine enum EditorTonemapOption: String, CaseIterable, Hashable, Identifiable { case agx = "AgX" case aces = "ACES" + /// No curve: the scene's linear colour as it is, for a mixed-immersion space where the + /// passthrough sets the display's response. + case none = "None" var id: String { rawValue @@ -28,6 +31,8 @@ enum EditorTonemapOption: String, CaseIterable, Hashable, Identifiable { return .agx case .aces: return .aces + case .none: + return .none } } @@ -37,6 +42,8 @@ enum EditorTonemapOption: String, CaseIterable, Hashable, Identifiable { return .agx case .aces: return .aces + case .none: + return .none } } }